This folder contains examples of MongoDB queries and operations performed using the MongoDB shell. These examples demonstrate how to interact with MongoDB collections, including inserting, querying, updating, and deleting documents.
The repository includes the following examples:
-
Library Book Collection
- Queries and operations for managing a library's book collection.
- Example queries are located in
complete/library-book-collection/mongo-queries.md.
-
Movie Collection
- Queries and operations for managing a movie database.
- Example queries are located in
complete/movie-collection/mongodb-queries.md.
-
School Enrollment
- Queries and operations for managing student enrollment records.
- Example queries are located in
complete/school-enrollment/mongodb-queries.md.
To use these MongoDB shell examples, follow these steps:
- Ensure MongoDB is installed and running on your machine or accessible via a remote server.
- Navigate to the appropriate folder for the example you want to explore.
- Open the
.mdfile in the corresponding folder to view the MongoDB queries. - Run the queries in the MongoDB shell (
mongosh) to interact with the database.
- These examples are designed for educational purposes and assume a basic understanding of MongoDB and its shell commands.
- Modify the database and collection names in the queries as needed to match your environment.
- For more information on MongoDB shell commands, refer to the MongoDB Documentation.