@@ -435,11 +435,19 @@ Yes. See the configuration guide for :ref:`pymongo-and-mod_wsgi`.
435
435
436
436
How can I use something like Python's :mod: `json ` module to encode my documents to JSON?
437
437
----------------------------------------------------------------------------------------
438
- The :mod: `json ` module won't work out of the box with all documents
439
- from PyMongo as PyMongo supports some special types (like
440
- :class: `~bson.objectid.ObjectId ` and :class: `~bson.dbref.DBRef `)
441
- that are not supported in JSON. We've added some utilities for working
442
- with JSON in the :mod: `~bson.json_util ` module.
438
+ :mod: `~bson.json_util ` is PyMongo's built in, flexible tool for using
439
+ Python's :mod: `json ` module with BSON documents and `MongoDB Extended JSON
440
+ <https://docs.mongodb.com/manual/reference/mongodb-extended-json/> `_. The
441
+ :mod: `json ` module won't work out of the box with all documents from PyMongo
442
+ as PyMongo supports some special types (like :class: `~bson.objectid.ObjectId `
443
+ and :class: `~bson.dbref.DBRef `) that are not supported in JSON.
444
+
445
+ `python-bsonjs <https://github.com/mongodb-labs/python-bsonjs >`_ is a fast
446
+ BSON to MongoDB Extended JSON converter built on top of
447
+ `libbson <https://github.com/mongodb/libbson >`_. `python-bsonjs ` does not
448
+ depend on PyMongo and can offer a nice performance improvement over
449
+ :mod: `~bson.json_util `. `python-bsonjs ` works best with PyMongo when using
450
+ :class: `~bson.raw_bson.RawBSONDocument `.
443
451
444
452
Why do I get OverflowError decoding dates stored by another language's driver?
445
453
------------------------------------------------------------------------------
0 commit comments