1. shell
    1. db
    2. use database
    3. insert
    4. batchInsert
    5. update
    6. Upserts
      1. insert or update
    7. remove
    8. save
      1. if _id is exist it will update otherwise
    9. help
      1. db.help()
      2. db.mycoll.help()
      3. ...
    10. show
      1. show dbs
      2. show collections
      3. show users
      4. ...
    11. modifier
      1. $set
      2. $inc
        1. Incrementing
      3. decrementing
        1. Subtopic 1
    12. modifier array
      1. $push
      2. $addToSet
      3. $each
      4. $pop
      5. $pull
    13. db.getLastError()
    14. Query
      1. find
        1. example
          1. db.users.find({"username" : "joe", "age" : 27})
        2. Specifying Which Keys to Return
        3. Criteria
          1. $lt
          2. $lte
          3. $gt
          4. $gte
          5. $or
          6. db.raffle.find({"$or" : [{"ticket_no" : 725}, {"winner" : true}]})
          7. $in
          8. db.raffle.find({"ticket_no" : {"$in" : [725, 542, 390]}})
          9. $not
          10. db.users.find({"id_num" : {"$not" : {"$mod" : [5, 1]}}})
          11. $mod
          12. db.users.find({"id_num" : {"$mod" : [5, 1]}})
        4. Conditional Semantics
          1. db.users.find({"age" : {"$lt" : 30, "$gt" : 20}})
          2. db.users.find({"$and" : [{"x" : {"$lt" : 1}}, {"x" : 4}]})
        5. null
          1. list all
          2. db.c.find()
        6. array
          1. one of them
          2. $all
          3. match all
          4. $size
          5. $slice
        7. Embedded Documents
          1. Subtopic 1
        8. $where
      2. sort
      3. limit
      4. skip
      5. _addSpecial
        1. $maxscan
        2. $min
        3. $max
        4. $showDiskLoc
      6. explain
      7. hint
    15. Server-Side Scripting
      1. turn javascript off
        1. running mongod with the --noscripting option.
      2. use parameters like sql
    16. Cursors
      1. open
        1. var cursor = db.collection.find();
      2. cursor.hasNext()
      3. obj = cursor.next();
      4. forEach
    17. database command
      1. drop
      2. getLastError
      3. shutdown
  2. data type
    1. null
    2. boolean
    3. number
    4. string
    5. date
    6. regular expression
    7. array
    8. embedded document
    9. object id
    10. binary data
    11. code
      1. JavaScript code:
  3. Index
    1. ensureIndex
  4. Aggregation
    1. aggregation framework lets you transform and combine documents in a collection
    2. pipeline
      1. filtering,
        1. projecting,
          1. grouping,
          2. sorting,
          3. limiting,
          4. skipping.
    3. example
    4. limited to 16 MB
    5. debug?
    6. function
      1. $match
      2. $project
        1. "$fieldname"
        2. Pipeline expressions
          1. Mathematical expressions.
          2. $add
          3. $subtract
          4. $multiply
          5. $divide
          6. $mod
          7. Date expressions.
          8. $year
          9. $month
          10. $week
          11. $dayOfMonth
          12. $dayOfWeek
          13. $dayOfYear
          14. $hour
          15. $minute
          16. $second
          17. String expressions.
          18. $substr
          19. $concat
          20. $toLower
          21. $toUpper
          22. Logical expressions.
          23. $cmp
          24. compare
          25. $strcasecmp
          26. "$eq"/"$ne"/"$gt"/"$gte"/"$lt"/"$lte"
          27. $and
          28. "$or"
          29. "$not"
          30. "$cond"
          31. "$ifNull"
      3. $group
        1. field name
          1. _id
          2. example
        2. operator
          1. $sum
          2. $average
          3. $avg
          4. $max
          5. $min
          6. $first
          7. $last
        3. Array operators.
          1. $addToSet
          2. $push
      4. $unwind
      5. $sort
      6. $limit
      7. $skip
  5. MapReduce
    1. syntax
      1. db.[collection].mapReduce
        1. mapfunction
          1. this is the current document
          2. return
          3. emit(key, value);
        2. reduce function
          1. params
          2. key
          3. list of values above
          4. return newobject
        3. {}
          1. out
          2. outputs the results to a collection
          3. query
          4. finalize