@@ -37,6 +37,11 @@ Warnings can also be changed to errors::
37
37
38
38
python -Wd -Werror <your application>
39
39
40
+ .. note :: Not all deprecated features raise :exc:`DeprecationWarning` when
41
+ used. For example, the :meth: `~pymongo.collection.Collection.find ` options
42
+ renamed in PyMongo 3.0 do not raise :exc: `DeprecationWarning ` when used in
43
+ PyMongo 2.x. See also `Removed features with no migration path `_.
44
+
40
45
CRUD API
41
46
--------
42
47
@@ -241,10 +246,24 @@ can be changed to this with PyMongo 2.9 or later:
241
246
242
247
.. seealso :: :meth:`~pymongo.database.Database.get_collection`
243
248
244
- The "tag_sets" attribute is removed
245
- ...................................
249
+ The "tag_sets" option and attribute are removed
250
+ ...............................................
246
251
247
- Code like this::
252
+ The `tag_sets ` MongoClient option is removed. The `read_preference `
253
+ option can be used instead. Code like this::
254
+
255
+ >>> client = MongoClient(
256
+ ... read_preference=ReadPreference.SECONDARY,
257
+ ... tag_sets=[{"dc": "ny"}, {"dc": "sf"}])
258
+
259
+ can be changed to this with PyMongo 2.9 or later:
260
+
261
+ .. doctest ::
262
+
263
+ >>> from pymongo.read_preferences import Secondary
264
+ >>> client = MongoClient(read_preference = Secondary([{" dc" : " ny" }]))
265
+
266
+ To change the tags sets for a Database or Collection, code like this::
248
267
249
268
>>> db = client.my_database
250
269
>>> db.read_preference = ReadPreference.SECONDARY
@@ -254,7 +273,6 @@ can be changed to this with PyMongo 2.9 or later:
254
273
255
274
.. doctest ::
256
275
257
- >>> from pymongo.read_preferences import Secondary
258
276
>>> db = client.get_database(" my_database" ,
259
277
... read_preference= Secondary([{" dc" : " ny" }]))
260
278
@@ -506,8 +524,8 @@ can be replaced by this in PyMongo 2.9 or later:
506
524
>>> from bson.son import SON
507
525
>>> encoded = BSON .encode({" a" : 1 }, codec_options = CodecOptions(SON ))
508
526
509
- Advice for features removed in PyMongo 3
510
- ----------------------------------------
527
+ Removed features with no migration path
528
+ ---------------------------------------
511
529
512
530
MasterSlaveConnection is removed
513
531
................................
0 commit comments