liveBook · Manning

BSON

As explained in The Quick Python Book, Fourth Edition

BSON is a binary-encoded data serialization format used by MongoDB for storing document data.

BSON, or binary JSON, is MongoDB’s document format. A BSON document stores key-value pairs and resembles both a JSON object and a Python dictionary. section 23.7

A BSON document through PyMongo

A Python dictionary such as {"name": "Jane", "age": 34, "interests": ["Python", "databases", "statistics"]} can be inserted into a MongoDB collection. Retrieval adds an _id ObjectId; queries, updates, replacement, and deletion operate on the stored document.

How The Quick Python Book, Fourth Edition covers it

How deep it goes
Defines BSON through document shape and demonstrates CRUD operations, but does not explain its binary encoding internals.
Examples
Uses a person document with scalar fields, an interests array, a datetime, an ObjectId, and CRUD operations.
What you can do after
Operate/configure MongoDB documents through PyMongo by inserting, querying, updating, replacing, and deleting BSON-backed records.
How it connects
Connects BSON with MongoDB, JSON, Python dictionaries, PyMongo, documents, collections, and ObjectId.

Also explained in

Compare how 2 books explain BSON →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Quick Python Book, Fourth Edition. The section links point to the parts of the book it draws on.