Skip to content

Commit 88ca35b

Browse files
committed
PYTHON-1316 Database.eval has no migration path on 4.2+
1 parent afd98e6 commit 88ca35b

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

doc/migrate-to-pymongo4.rst

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,23 @@ Warnings can also be changed to errors::
5050
.. note:: Not all deprecated features raise :exc:`DeprecationWarning` when
5151
used. See `Removed features with no migration path`_.
5252

53-
Database
54-
--------
53+
Removed features with no migration path
54+
---------------------------------------
5555

56-
The "eval" method and SystemJS class are removed
57-
................................................
56+
Database.eval, Database.system_js, and SystemJS are removed
57+
...........................................................
5858

5959
Removed :meth:`~pymongo.database.Database.eval`,
6060
:data:`~pymongo.database.Database.system_js` and
6161
: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+.
6364

64-
Code like this::
65+
However, on MongoDB <= 4.0, code like this::
6566

6667
>>> result = database.eval('function (x) {return x;}', 3)
6768

68-
can be changed to this with MongoDB <= 4.0::
69+
can be changed to this::
6970

7071
>>> from bson.code import Code
7172
>>> 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

Comments
 (0)