Show Menu
Cheatography

MongoDB Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Termin­ology

Database
Like RDBMS database
 
Contains Collec­tions
Collection
Like RDBMS table
 
Contains Documents
Document
Like RDBMS row
 
Contains fields
 
Fields are defined document level
   

Insert

Insert
db.uni­cor­ns.i­ns­ert­({name: 'Leto', gender­:'m', home:'­Arr­akeen', worm: false})
Find
Find all: db.uni­cor­ns.f­ind()

Find

all
db.uni­cor­ns.f­ind()