File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 11Custom Type Example
22===================
33
4+ .. warning :: The following examples document a deprecated feature. The
5+ :class: `~pymongo.son_manipulator.SONManipulator ` API has limitations as a
6+ technique for transforming your data. Instead, it is more flexible and
7+ straightforward to transform outgoing documents in your own code before
8+ passing them to PyMongo, and transform incoming documents after receiving
9+ them from PyMongo.
10+
11+ Thus the :meth: `~pymongo.database.Database.add_son_manipulator ` method is
12+ deprecated. PyMongo 3's new CRUD API does **not ** apply SON manipulators to
13+ documents passed to :meth: `~pymongo.collection.Collection.bulk_write `,
14+ :meth: `~pymongo.collection.Collection.insert_one `,
15+ :meth: `~pymongo.collection.Collection.insert_many `,
16+ :meth: `~pymongo.collection.Collection.update_one `, or
17+ :meth: `~pymongo.collection.Collection.update_many `. SON manipulators are
18+ **not ** applied to documents returned by the new methods
19+ :meth: `~pymongo.collection.Collection.find_one_and_delete `,
20+ :meth: `~pymongo.collection.Collection.find_one_and_replace `, and
21+ :meth: `~pymongo.collection.Collection.find_one_and_update `.
22+
23+
424This is an example of using a custom type with PyMongo. The example
525here is a bit contrived, but shows how to use a
626:class: `~pymongo.son_manipulator.SONManipulator ` to manipulate
You can’t perform that action at this time.
0 commit comments