results – Result class definitions¶
Result class definitions.
- class pymongo.results.BulkWriteResult(bulk_api_result: Dict[str, Any], acknowledged: bool)¶
Create a BulkWriteResult instance.
- Parameters
bulk_api_result: A result dict from the bulk API
acknowledged: Was this write result acknowledged? If
Falsethen all properties of this object will raiseInvalidOperation.
- property acknowledged: bool¶
Is 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
- class pymongo.results.DeleteResult(raw_result: Dict[str, Any], acknowledged: bool)¶
The return type for
delete_one()anddelete_many()- property acknowledged: bool¶
Is 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
- class pymongo.results.InsertManyResult(inserted_ids: List[Any], acknowledged: bool)¶
The return type for
insert_many().- property acknowledged: bool¶
Is 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
- property inserted_ids: List¶
A 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: Any, acknowledged: bool)¶
The return type for
insert_one().- property acknowledged: bool¶
Is 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
- property inserted_id: Any¶
The inserted document’s _id.
- class pymongo.results.UpdateResult(raw_result: Dict[str, Any], acknowledged: bool)¶
The return type for
update_one(),update_many(), andreplace_one().- property acknowledged: bool¶
Is 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
- property upserted_id: Any¶
The _id of the inserted document if an upsert took place. Otherwise
None.