operations
– Operation class definitions
class pymongo.operations.DeleteMany
(filter, collation=None, hint=None)
Create a DeleteMany instance.
For use with bulk_write().
Changed in version 3.11: Added the hint
option.
Changed in version 3.5: Added the collation option.
class pymongo.operations.DeleteOne
(filter, collation=None, hint=None)
Create a DeleteOne instance.
For use with .
Parameters: |
|
---|
Changed in version 3.11: Added the hint
option.
Changed in version 3.5: Added the collation option.
class pymongo.operations.IndexModel
(keys, \*kwargs*)
Create an Index instance.
For use with create_indexes().
Valid options include, but are not limited to:
See the MongoDB documentation for a full list of supported options by server version.
Changed in version 3.11: Added the hidden
option.
Changed in version 3.2: Added the partialFilterExpression
option to support partial indexes.
document
An index document suitable for passing to the createIndexes command.
class pymongo.operations.InsertOne
(document)
Create an InsertOne instance.
For use with .
Parameters: |
|
---|
class (filter, replacement, upsert=False, collation=None, hint=None)
Create a ReplaceOne instance.
For use with bulk_write().
Changed in version 3.11: Added the hint
option.
class pymongo.operations.UpdateMany
(filter, update, upsert=False, collation=None, array_filters=None, hint=None)
Create an UpdateMany instance.
For use with .
Parameters: |
|
---|
Changed in version 3.11: Added the hint option.
Changed in version 3.9: Added the ability to accept a pipeline as the update.
Changed in version 3.6: Added the array_filters option.
Changed in version 3.5: Added the collation option.
class pymongo.operations.UpdateOne
(filter, update, upsert=False, collation=None, array_filters=None, hint=None)
Represents an update_one operation.
For use with bulk_write().
Changed in version 3.11: Added the hint option.
Changed in version 3.9: Added the ability to accept a pipeline as the update.
Changed in version 3.6: Added the array_filters option.