What is BSON?

BeginnerConceptMongoDB
Answer

Short answer

BSON (Binary JSON) is the binary format MongoDB uses to store documents on disk and send them over the network. It looks like JSON to you, but it's faster to parse and supports extra types that JSON lacks — like ObjectId, Date, Decimal128, Int64 and binary data.

Example

{
  _id: ObjectId("6650f1c2a7b3e4d5f6a7b8c9"),   // 12-byte id
  createdAt: ISODate("2026-11-26T10:15:00Z"), // real date type
  total: NumberDecimal("52000.50"),           // exact decimal for money
  qty: NumberInt(3)
}

Why it matters

  • Store money as Decimal128, not floating point, to avoid rounding errors.
  • Store dates as real dates so range queries and TTL indexes work.
  • mongodump writes .bson files; mongoexport writes human-readable JSON/CSV (but loses some type information).

What to say in the interview

"BSON is MongoDB's binary JSON encoding — efficient to traverse, with extra types like ObjectId, Date and Decimal128. That's why we use mongodump for backups, since it preserves types, and mongoexport only for human-readable exports."

All Databases (MySQL, PostgreSQL, MongoDB) questions Roadmap: MongoDB basics

More on MongoDB