{"id":23384341,"url":"https://github.com/tlklein/mongodb-exercises","last_synced_at":"2026-05-07T14:43:02.665Z","repository":{"id":269082867,"uuid":"794825225","full_name":"tlklein/mongodb-exercises","owner":"tlklein","description":"This repository contains a series of exercises designed to help users practice basic MongoDB operations such as creating databases, inserting documents, querying collections, and using advanced query operators. The exercises include screenshots and explanations to guide users through each task.","archived":false,"fork":false,"pushed_at":"2024-12-20T19:20:12.000Z","size":542,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T07:23:46.462Z","etag":null,"topics":["cli","mongodb","mongoosejs","terminal"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tlklein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-02T03:06:19.000Z","updated_at":"2024-12-20T19:20:15.000Z","dependencies_parsed_at":"2024-12-20T19:52:26.373Z","dependency_job_id":null,"html_url":"https://github.com/tlklein/mongodb-exercises","commit_stats":null,"previous_names":["tlklein/mongodb-exercises"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlklein%2Fmongodb-exercises","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlklein%2Fmongodb-exercises/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlklein%2Fmongodb-exercises/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlklein%2Fmongodb-exercises/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tlklein","download_url":"https://codeload.github.com/tlklein/mongodb-exercises/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829517,"owners_count":21002997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","mongodb","mongoosejs","terminal"],"created_at":"2024-12-21T23:18:35.843Z","updated_at":"2025-10-23T19:02:29.064Z","avatar_url":"https://github.com/tlklein.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# MongoDB Exercises\n\nThis repository contains a series of exercises designed to help users practice basic MongoDB operations such as creating databases, inserting documents, querying collections, and using advanced query operators. The exercises include screenshots and explanations to guide users through each task.\n\n## Exercise A: Create and List Databases\n\n1. Create a new database named `employees` using the `use` command.\n2. List all databases on your MongoDB instance.\n\n### Screenshot\n![Exercise A](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm2%20part%20a.png)\n\n\n## Exercise B: Create, Drop, and List Collections\n\n1. Create a database named `temporary`, add a collection named `test` to it, and then drop the database. Report the output of `show dbs` and `show collections` before and after the database drop.\n\n### Screenshot\n![Exercise B1](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm2%20part%20b.png)\n\n2. Create multiple collections using department names in the database created in Exercise A.\n3. List all collections in the current database.\n\n### Screenshot\n![Exercise B2](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20part%20b%202.png)\n\n\n## Exercise C: Inserting and Retrieving Documents\n\n1. Insert some employee documents with fields (employee id, name, and salary) into multiple collections created in previous exercises.\n2. Use the `find` command to retrieve all the entered data.\n\n### Screenshot\n![Exercise C](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20part%20c.png)\n\n## Exercise D: Querying Documents\n\n1. Add the following employees to any collections.\n2. Find 2 documents using the `employee id` field.\n3. Find all documents where the `name` field starts with \"John\".\n4. Find all documents where the `name` field contains \"John\".\n5. Find 2 documents using the `name` field.\n\n### Screenshot\n![Exercise D](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20part%20d.png)\n\n\n## Exercise E: Working with `zips.json`\n\n0. Import the `zips.json` file into MongoDB.\n\n### Screenshot\n![Exercise E0](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20import.png)\n\n1. Get all cities with a population of less than 1500.\n\n### Screenshot\n![Exercise E1](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20part%20e%201.png)\n\n2. Find all data for the city \"CHESTER\" using a query operator.\n\n### Screenshot\n![Exercise E2](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20part%20e%202.5.png)\n\n3. Use the array query operator to find all entries for locations at `(-84.38570799999999, 45.015207)`.\n\n### Screenshot\n![Exercise E3](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20part%20e%202.png)\n\n4. Use a logical operator to find all entries that match the city \"WARREN\", or the location at `(-80.76424299999999, 41.231819)`.\n\n### Screenshot\n![Exercise E4](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20part%20e%203.png)\n\n\n## Exercise F: Using the `$where` Operator\n\n1. Use the `$where` operator to find all employees with a salary over 75,000.\n2. Use the `$where` operator to find all employees where the `name` contains \"John\".\n\n### Screenshot\n![Exercise F](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20part%20f.png)\n\n\n## Exercise G: Querying Specific Fields\n\n1. Using only one collection from the `employees` database, query all documents in that collection but return only the `name` and `salary` fields.\n\n### Screenshot\n![Exercise G](https://github.com/tlklein/mongodb-exercises/blob/0b44631d43d3c72f1bd2c7fb781898765d47cfae/screenshots/hm%202%20part%20g.png)\n\n\n## About the Author\n\nThis activity was completed as part of the **CIS 4338 Database Administration \u0026 Implementation** course at the University of Houston under the guidance of Professor Susan Miertschin.\n\n---\n\nFeel free to contribute, provide feedback, or discuss improvements!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlklein%2Fmongodb-exercises","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlklein%2Fmongodb-exercises","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlklein%2Fmongodb-exercises/lists"}