Python MongoDB

MongoDB Collection

Working with collections

MongoDB Collection

A collection in MongoDB is the same as a table in SQL databases. A collection is created when you first insert data into it.

Create Collection

mydb = myclient["mydatabase"]
mycol = mydb["customers"]