Documentation of the MongoDB basics with focus on querying a MongoDB database / collection
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is a summary of the basic usage of MongoDB. The idea is to have a short overview with no flood and deep explanations. There are tons of good documentations. It’s not a Cheat-Sheet yet but maybe I will transform it into one later.

  • If you are a MongoDB noob, this is perfect for you. I strongly recommend following the good course M101: MongoDB for Developers course given by 10gen.

  • If you are a MongoDB intermediate this could be a short reference.

  • If you are a MongoDB pro ... I can’t help you ;-)

Import data

In the data folder, you can find some example datafiles. Import them to the database and collection of your choice. Here I use the database called cities and import data from zips.json to a collection called zips:

mongoimport -d cities -c zips --drop < zips.json

These datafiles have been provided by 10gen during the M101 course.


This is work in progress


Creative Commons License
mongodb_basics by Andy Wenk is licensed under a Creative Commons Attribution 3.0 Unported License.
Based on a work at