-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-1320 Remove legacy CRUD methods #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove save, insert, update, remove, and find_and_modify.
@@ -24,7 +24,7 @@ warning: | |||
|
|||
.. code-block:: python | |||
|
|||
# "insert.py" | |||
# "insert.py" (with PyMongo 3.X) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section provides example output for deprecation warnings which only work on PyMongo 3.X (because PyMongo 4.0 removes all the deprecated APIs).
@@ -1,4 +1,4 @@ | |||
# Copyright 2009-2015 MongoDB, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This benchmark actually works now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This benchmark isn't great and never really has been. Let's just get rid of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
# Can't use fsync and j options together | ||
self.assertRaises(ConfigurationError, WriteConcern, j=True, fsync=True) | ||
# Can't use w=0 and j options together | ||
self.assertRaises(ConfigurationError, WriteConcern, w=0, j=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this test to avoid loosing test coverage when deleting test_legacy_api.
wait_until(lambda: 2 == db.collection_4.count_documents({}), | ||
'insert 2 documents', timeout=60) | ||
|
||
db.collection_4.drop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added these tests to avoid loosing test coverage when deleting test_legacy_api.
@@ -220,9 +223,9 @@ is displayed: | |||
.. code-block:: javascript | |||
|
|||
> // mongo shell. | |||
> db.collection.insert( { "_id" : 1, "subdocument" : { "b" : 1, "a" : 1 } } ) | |||
> db.collection.insertOne( { "_id" : 1, "subdocument" : { "b" : 1, "a" : 1 } } ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shell has implemented the CRUD spec for a while now.
@@ -1,4 +1,4 @@ | |||
# Copyright 2009-2015 MongoDB, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This benchmark isn't great and never really has been. Let's just get rid of it.
Remove save, insert, update, remove, and find_and_modify.