results – 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 raise InvalidOperation.

    • property acknowledged

      Is this the result of an acknowledged write operation?

      The attribute will be False when using WriteConcern(w=0), otherwise True.

      Note

      If the acknowledged attribute is False all other attibutes of this class will raise when accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.

      See also

      WriteConcern

    • property bulk_api_result

      The raw bulk API result.

    • property deleted_count

      The number of documents deleted.

    • property inserted_count

      The number of documents inserted.

    • property modified_count

      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 mixed version sharding configurations, this attribute will be set to None.

    • property upserted_count

      The number of documents upserted.

    • property upserted_ids

    class pymongo.results.DeleteResult(raw_result, acknowledged)

    The return type for and delete_many()

    • property acknowledged

      Is this the result of an acknowledged write operation?

      The attribute will be False when using , otherwise True.

      Note

      If the acknowledged attribute is False all other attibutes of this class will raise when accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.

      See also

      WriteConcern

    • property deleted_count

      The number of documents deleted.

    • property raw_result

      The raw result document returned by the server.

    class pymongo.results.InsertManyResult(inserted_ids, acknowledged)

    The return type for .

    • property acknowledged

      Is this the result of an acknowledged write operation?

      The acknowledged attribute will be False when using WriteConcern(w=0), otherwise True.

      Note

      If the attribute is False all other attibutes of this class will raise InvalidOperation when accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.

      See also

    class pymongo.results.InsertOneResult(inserted_id, acknowledged)

    • property acknowledged

      Is this the result of an acknowledged write operation?

      The acknowledged attribute will be False when using , otherwise True.

      Note

      If the attribute is False all other attibutes of this class will raise InvalidOperation when accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.

      See also

    • property inserted_id

      The inserted document’s _id.

    class pymongo.results.UpdateResult(raw_result, acknowledged)

    The return type for update_one(), , and replace_one().

    • property acknowledged

      Is this the result of an acknowledged write operation?

      The attribute will be False when using WriteConcern(w=0), otherwise True.

      Note

      If the acknowledged attribute is False all other attibutes of this class will raise when accessed. Values for other attributes cannot be determined if the write operation was unacknowledged.

      See also

      WriteConcern

    • property matched_count

      The number of documents matched for this update.

    • property modified_count

      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 mixed version sharding configurations, this attribute will be set to None.

    • property raw_result

      The raw result document returned by the server.

    • property upserted_id