@@ -50,27 +50,23 @@ Warnings can also be changed to errors::
50
50
.. note :: Not all deprecated features raise :exc:`DeprecationWarning` when
51
51
used. See `Removed features with no migration path `_.
52
52
53
- Database
54
- --------
53
+ Removed features with no migration path
54
+ ---------------------------------------
55
55
56
- The " eval" method and SystemJS class are removed
57
- ................................................
56
+ Database. eval, Database.system_js, and SystemJS are removed
57
+ ...........................................................
58
58
59
59
Removed :meth: `~pymongo.database.Database.eval `,
60
60
:data: `~pymongo.database.Database.system_js ` and
61
61
:class: `~pymongo.database.SystemJS `. The eval command was deprecated in
62
- MongoDB 3.0 and removed in MongoDB 4.2.
62
+ MongoDB 3.0 and removed in MongoDB 4.2. There is no replacement for eval with
63
+ MongoDB 4.2+.
63
64
64
- Code like this::
65
+ However, on MongoDB <= 4.0, code like this::
65
66
66
67
>>> result = database.eval('function (x) {return x;}', 3)
67
68
68
- can be changed to this with MongoDB <= 4.0 ::
69
+ can be changed to this::
69
70
70
71
>>> from bson.code import Code
71
72
>>> result = database.command('eval', Code('function (x) {return x;}'), args=[3]).get('retval')
72
-
73
- There is no replacement for eval with MongoDB 4.2+.
74
-
75
- Removed features with no migration path
76
- ---------------------------------------
0 commit comments