RandomWits

life is too short for a diary




MongoDB Crib Sheet

Tags: mongodb

Author
Written by: Tushar Sharma
Featured image for MongoDB Crib Sheet

MongoDB Crib Sheet. Mongo uses BSON to store data

Document Structure (BSON)

{
  _id: ObjectId("507f191e810c19729de860ea"),
  name: "Alice Chen",
  salary: NumberLong(230000),
  designation: "Principal Engineer",
  teams: ["platform-engineering", "database-ops"],
  meta: {
    badge: "SDE-III",
    clearance: "Level-5"
  }
}
  • Binary JSON format with type-rich encoding

  • Flexible schema (no fixed column structure)

  • Nested documents (up to 100 levels deep)

  • Automatic _id generation (12-byte unique identifier)


comments powered by Disqus