Mongo

SQL Comparison

SQL Term MongoDB Term
Database Dtabase
Table Collections
Row Document or BSON
Column Field
index index
table joins $lookup, embedded documents
primary key _id field
aggregation aggregation pipeline (SQL Aggregation Mapping Char)
SELECT INTO NEW_TABLE $out
MERGE INTO TABLE $merge
transaction transaction

Shell Cheatsheet

mongo --host mongodb0.example.com --port 28015

REPL Cheatsheet

use DATABASE_NAME
show dbs
db.createUser({user:"mongouser",pwd:"mongopass",roles:[{role:"readWrite",db:"mongodb"}]})
db.auth({user:"mongouser",pwd:"mongopass",digestPassword: true})

Query Cheatsheet

db.test.find().limit(10)
db.test.find(ObjectId('4ecc05e55dd98a436ddcc47c'))