Skip to main content

What does a BSON document example look like?

BSON is a binary format, so a "real" document in it looks like a set of bytes. But logically it corresponds to a JSON structure. It's easier to show an example in the JSON form that BSON represents internally:

json
{ "_id": ObjectId("6512bd43d9caa6e02c990b0a"), "name": "Alex", "age": 25, "isActive": true, "skills": ["MongoDB", "Node.js"], "createdAt": ISODate("2025-10-22T10:00:00Z"), "profile": { "city": "Berlin", "status": "developer" } }

What matters here

  • ObjectId and ISODate are special BSON types (JSON has no equivalent)
  • arrays and nested objects are supported natively
  • the document is stored as key-value pairs and stays a coherent structure

Inside MongoDB this object is stored in binary BSON form, but for reading and display it's usually shown as JSON.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.