Lesson

Create or Remove MongoDB Collection

Learn to create and remove MongoDB collections using MongoDB Compass and the Mongo shell in this practical lesson on collection management.

Access
Included
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!