Course lesson

Create or Remove MongoDB Collection

In this lesson, we learn that creating a MongoDB collection can be done easily through MongoDB Compass or the Mongo shell: mongosh.

Duration
4 min
Access
Free
Transcript
Needs source

In this lesson, we learn that creating a MongoDB collection can be done easily through MongoDB Compass or the Mongo shell: mongosh.

We cover how to use the GUI to add a new collection and understand that there’s no need for a predefined schema, allowing us to store documents with varying structures.

We also discuss how to remove a collection when it’s no longer needed, demonstrating both methods for flexibility in managing our database.

We also see find, countDocuments and drop MongoDB collection methods in action!