liveBook · Manning

Extended JSON

As explained in MongoDB 8.0 in Action, Third Edition

Extended JSON is a human-readable JSON extension that represents BSON and other data types not natively supported by standard JSON.

Extended JSON (EJSON) is a human-readable, machine-parsable extension of standard JSON that represents MongoDB data types such as dates, binary data, and ObjectIds. Stream processors accept EJSON when receiving continuous document streams. section 15.5.1 section 15.9

Streaming database documents

A $source aggregation stage can receive documents from a Kafka topic, MongoDB change stream, or document array when those documents use valid JSON or EJSON. EJSON preserves richer database values that ordinary JSON cannot represent. section 15.5.1 section 15.9

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Defines EJSON’s purpose and supported types, but stops short of specifying detailed encoding syntax.
Examples
Uses dates, binary data, ObjectIds, Kafka messages, MongoDB change streams, and document arrays as examples.
What it assumes
Assumes familiarity with JSON documents and MongoDB-style data, while distinguishing unsupported types from standard JSON.
What you can do after
Evaluate whether streamed documents require EJSON to preserve MongoDB-specific data types.
How it connects
Connects standard JSON, BSON, MongoDB data types, aggregation pipelines, and stream processing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of MongoDB 8.0 in Action, Third Edition. The section links point to the parts of the book it draws on.