Back to Languages

Mongodb Tutorial

Learn Mongodb interactively. Read the concept and write code to practice.

1. MongoDB Introduction

MongoDB is a document database designed for ease of development and scaling. It...

2. Create Database & Collection

**Create Database** In MongoDB, you don't explicitly create a database. When you...

3. Insert Document

To insert data into a MongoDB collection, you use the `insertOne()` or `insertMa...

4. Find (Query) Documents

To select data from a collection in MongoDB, we can use the `find()` method. - ...

5. Query Operators

MongoDB provides several query operators to specify more complex conditions. Co...

6. Logical Operators

MongoDB provides logical operators that allow you to combine multiple conditions...

7. Update Document

To update documents in a collection, you can use `updateOne()` or `updateMany()`...

8. Delete Document

To delete documents from a collection, use `deleteOne()` or `deleteMany()`. - `...

9. Sort & Limit

When querying data, you might want to sort the results or limit the number of do...

10. Projection

In MongoDB, projection means selecting only the necessary data rather than selec...

11. Array Updates

MongoDB provides specific operators to update arrays inside documents. - `$push...

12. Aggregation Pipeline

Aggregation operations process multiple documents and return computed results. ...