Skip to content

MongoDB Queries in a Nutshell

Emidio Piermarini edited this page Jan 11, 2018 · 27 revisions

Introduction

This wikipage will attempt to get you the 'low hanging fruit' in with MongoDB. With the following commands, you can do 80% of what a typical BH engineer will have to do with their data. If you want further information, please see MongoDB's online documentation: MongoDB Reference Manual.

As you will see, MongoDB's computer language is fairly easy to learn. Whilst it isn't extremely human readable, it is certainly more straightforward than things like nested loops. All of MongoDB's language is based on JSON syntax. It is worth looking a bit at the sytanx before jumping into Mongo Queries. Simply speaking, JSON script will usually look like this:

{"Key": Value} or {"Mongo Query Name": Stuff to Do}

Important Queries

$project

$match

$group

$aggregate

Clone this wiki locally