Skip to content

Commit d6eb05b

Browse files
committed
PYTHON-1316 Database.eval has no migration path on 4.2+
1 parent 55be9d6 commit d6eb05b

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
@@ -43,27 +43,23 @@ Warnings can also be changed to errors::
4343
.. note:: Not all deprecated features raise :exc:`DeprecationWarning` when
4444
used. See `Removed features with no migration path`_.
4545

46-
Database
47-
--------
46+
Removed features with no migration path
47+
---------------------------------------
4848

49-
The "eval" method and SystemJS class are removed
50-
................................................
49+
Database.eval, Database.system_js, and SystemJS are removed
50+
...........................................................
5151

5252
Removed :meth:`~pymongo.database.Database.eval`,
5353
:data:`~pymongo.database.Database.system_js` and
5454
:class:`~pymongo.database.SystemJS`. The eval command was deprecated in
55-
MongoDB 3.0 and removed in MongoDB 4.2.
55+
MongoDB 3.0 and removed in MongoDB 4.2. There is no replacement for eval with
56+
MongoDB 4.2+.
5657

57-
Code like this::
58+
However, on MongoDB <= 4.0, code like this::
5859

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

61-
can be changed to this with MongoDB <= 4.0::
62+
can be changed to this::
6263

6364
>>> from bson.code import Code
6465
>>> result = database.command('eval', Code('function (x) {return x;}'), args=[3]).get('retval')
65-
66-
There is no replacement for eval with MongoDB 4.2+.
67-
68-
Removed features with no migration path
69-
---------------------------------------

0 commit comments

Comments
 (0)