results – Result class definitions
Result class definitions.
- class
pymongo.results.
BulkWriteResult
(bulk_api_result, acknowledged) - Create a BulkWriteResult instance.
Parameters:
- bulk_api_result: A result dict from the bulk API
- acknowledged: Was this write result acknowledged? If
False
then all properties of this object will raiseInvalidOperation
.
The acknowledged
attribute will be False
when usingWriteConcern(w=0)
, otherwise True
.
Note
If the acknowledged
attribute is False
all otherattibutes of this class will raiseInvalidOperation
when accessed. Values forother attributes cannot be determined if the write operation wasunacknowledged.
See also
bulk_api_result
The raw bulk API result.
The number of documents deleted.
The number of documents inserted.
The number of documents matched for an update.
- The 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 mixedversion sharding configurations, this attribute will be set toNone
.
upserted_count
The number of documents upserted.
- A map of operation index to the _id of the upserted document.
- class
pymongo.results.
DeleteResult
(raw_result, acknowledged) The return type for
delete_one()
anddelete_many()
The acknowledged
attribute will be False
when usingWriteConcern(w=0)
, otherwise True
.
Note
If the acknowledged
attribute is False
all otherattibutes of this class will raiseInvalidOperation
when accessed. Values forother attributes cannot be determined if the write operation wasunacknowledged.
See also
- class
pymongo.results.
InsertManyResult
(inserted_ids, acknowledged) The return type for
insert_many()
.
The acknowledged
attribute will be False
when usingWriteConcern(w=0)
, otherwise True
.
Note
If the acknowledged
attribute is False
all otherattibutes of this class will raiseInvalidOperation
when accessed. Values forother attributes cannot be determined if the write operation wasunacknowledged.
See also
Note
If False
is passed for the ordered parameter toinsert_many()
the servermay have inserted the documents in a different order than whatis presented here.
- class
pymongo.results.
InsertOneResult
(inserted_id, acknowledged) The return type for
insert_one()
.
The acknowledged
attribute will be False
when usingWriteConcern(w=0)
, otherwise True
.
Note
If the acknowledged
attribute is False
all otherattibutes of this class will raiseInvalidOperation
when accessed. Values forother attributes cannot be determined if the write operation wasunacknowledged.
See also
- class
pymongo.results.
UpdateResult
(raw_result, acknowledged) The return type for
update_one()
,update_many()
, andreplace_one()
.
The acknowledged
attribute will be False
when usingWriteConcern(w=0)
, otherwise True
.
Note
If the acknowledged
attribute is False
all otherattibutes of this class will raiseInvalidOperation
when accessed. Values forother attributes cannot be determined if the write operation wasunacknowledged.
See also
Note
modified_count is only reported by MongoDB 2.6 and later.When connected to an earlier server version, or in certain mixedversion sharding configurations, this attribute will be set toNone
.