results – Result class definitions
Result class definitions.
class pymongo.results.``BulkWriteResult(bulk_api_result, acknowledged)
Create a BulkWriteResult instance.
| Parameters: |
|
|---|
acknowledgedIs this the result of an acknowledged write operation?
The
acknowledgedattribute will beFalsewhen usingWriteConcern(w=0), otherwiseTrue.Note
If the
acknowledgedattribute isFalseall other attibutes of this class will raiseInvalidOperationwhen accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.See also
bulk_api_resultThe raw bulk API result.
deleted_countThe number of documents deleted.
inserted_countThe number of documents inserted.
matched_countThe number of documents matched for an update.
modified_countThe number of documents modified.
Note
modified_count is only reported by MongoDB 2.6 and later. When connected to an earlier server version, or in certain mixed version sharding configurations, this attribute will be set to
None.upserted_countThe number of documents upserted.
upserted_idsA map of operation index to the _id of the upserted document.
class pymongo.results.``DeleteResult(raw_result, acknowledged)
The return type for delete_one() and delete_many()
acknowledgedIs this the result of an acknowledged write operation?
The
acknowledgedattribute will beFalsewhen usingWriteConcern(w=0), otherwiseTrue.Note
If the
acknowledgedattribute isFalseall other attibutes of this class will raiseInvalidOperationwhen accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.See also
deleted_countThe number of documents deleted.
raw_resultThe raw result document returned by the server.
class pymongo.results.``InsertManyResult(inserted_ids, acknowledged)
The return type for insert_many().
acknowledgedIs this the result of an acknowledged write operation?
The
acknowledgedattribute will beFalsewhen usingWriteConcern(w=0), otherwiseTrue.Note
If the
acknowledgedattribute isFalseall other attibutes of this class will raiseInvalidOperationwhen accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.See also
inserted_idsA list of _ids of the inserted documents, in the order provided.
Note
If
Falseis passed for the ordered parameter toinsert_many()the server may have inserted the documents in a different order than what is presented here.
class pymongo.results.``InsertOneResult(inserted_id, acknowledged)
The return type for insert_one().
acknowledgedIs this the result of an acknowledged write operation?
The
acknowledgedattribute will beFalsewhen usingWriteConcern(w=0), otherwiseTrue.Note
If the
acknowledgedattribute isFalseall other attibutes of this class will raiseInvalidOperationwhen accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.See also
inserted_idThe inserted document’s _id.
class pymongo.results.``UpdateResult(raw_result, acknowledged)
The return type for update_one(), update_many(), and replace_one().
acknowledgedIs this the result of an acknowledged write operation?
The
acknowledgedattribute will beFalsewhen usingWriteConcern(w=0), otherwiseTrue.Note
If the
acknowledgedattribute isFalseall other attibutes of this class will raiseInvalidOperationwhen accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.See also
matched_countThe number of documents matched for this update.
modified_countThe number of documents modified.
Note
modified_count is only reported by MongoDB 2.6 and later. When connected to an earlier server version, or in certain mixed version sharding configurations, this attribute will be set to
None.raw_resultThe raw result document returned by the server.
upserted_idThe _id of the inserted document if an upsert took place. Otherwise
None.
Previous topic
read_preferences – Utilities for choosing which member of a replica set to read from.
Next topic
son_manipulator – Manipulators that can edit SON documents as they are saved or retrieved