/** * Gets the "n" field, which contains the number of documents affected in the write operation. * * @return the value of the "n" field * @throws UnsupportedOperationException if the write was unacknowledged * @see WriteConcern#UNACKNOWLEDGED */ public int getN() { throwIfUnacknowledged("n"); return n; }
/** * Returns true if this write resulted in an update of an existing document. * * @return whether the write resulted in an update of an existing document. * @throws UnsupportedOperationException if the write was unacknowledged * @since 2.12 */ public boolean isUpdateOfExisting() { throwIfUnacknowledged("updateOfExisting"); return updateOfExisting; }
/** * Gets the _id value of an upserted document that resulted from this write. Note that for MongoDB servers prior to version 2.6, * this method will return null unless the _id of the upserted document was of type ObjectId. * * @return the value of the _id of an upserted document, which may be null * @throws UnsupportedOperationException if the write was unacknowledged * @since 2.12 */ @Nullable public Object getUpsertedId() { throwIfUnacknowledged("upsertedId"); return upsertedId; }
/** * Returns true if this write resulted in an update of an existing document. * * @return whether the write resulted in an update of an existing document. * @throws UnsupportedOperationException if the write was unacknowledged * @since 2.12 */ public boolean isUpdateOfExisting() { throwIfUnacknowledged("updateOfExisting"); return updateOfExisting; }
/** * Gets the "n" field, which contains the number of documents affected in the write operation. * * @return the value of the "n" field * @throws UnsupportedOperationException if the write was unacknowledged * @see WriteConcern#UNACKNOWLEDGED */ public int getN() { throwIfUnacknowledged("n"); return n; }
/** * Gets the _id value of an upserted document that resulted from this write. Note that for MongoDB servers prior to version 2.6, * this method will return null unless the _id of the upserted document was of type ObjectId. * * @return the value of the _id of an upserted document, which may be null * @throws UnsupportedOperationException if the write was unacknowledged * @since 2.12 */ @Nullable public Object getUpsertedId() { throwIfUnacknowledged("upsertedId"); return upsertedId; }