Package com.mongodb.bulk
Class BulkWriteResult
- java.lang.Object
-
- com.mongodb.bulk.BulkWriteResult
-
@Deprecated(since="2021-05-27") public abstract class BulkWriteResult extends java.lang.Object
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.The result of a successful bulk write operation.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description BulkWriteResult()
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static BulkWriteResult
acknowledged(int insertedCount, int matchedCount, int removedCount, java.lang.Integer modifiedCount, java.util.List<BulkWriteUpsert> upserts)
Deprecated.Create an acknowledged BulkWriteResultstatic BulkWriteResult
acknowledged(WriteRequest.Type type, int count, java.lang.Integer modifiedCount, java.util.List<BulkWriteUpsert> upserts)
Deprecated.Create an acknowledged BulkWriteResultstatic BulkWriteResult
acknowledged(WriteRequest.Type type, int count, java.util.List<BulkWriteUpsert> upserts)
Deprecated.Create an acknowledged BulkWriteResultabstract int
getDeletedCount()
Deprecated.Returns the number of documents deleted by the write operation.abstract int
getInsertedCount()
Deprecated.Returns the number of documents inserted by the write operation.abstract int
getMatchedCount()
Deprecated.Returns the number of documents matched by updates or replacements in the write operation.abstract int
getModifiedCount()
Deprecated.Returns the number of documents modified by the write operation.abstract java.util.List<BulkWriteUpsert>
getUpserts()
Deprecated.Gets an unmodifiable list of upserted items, or the empty list if there were none.abstract boolean
isModifiedCountAvailable()
Deprecated.no longer needed since all supported server versions support modified countstatic BulkWriteResult
unacknowledged()
Deprecated.Create an unacknowledged BulkWriteResultabstract boolean
wasAcknowledged()
Deprecated.Returns true if the write was acknowledged.
-
-
-
Method Detail
-
wasAcknowledged
public abstract boolean wasAcknowledged()
Deprecated.Returns true if the write was acknowledged.- Returns:
- true if the write was acknowledged
- See Also:
WriteConcern.UNACKNOWLEDGED
-
getInsertedCount
public abstract int getInsertedCount()
Deprecated.Returns the number of documents inserted by the write operation.- Returns:
- the number of documents inserted by the write operation
- Throws:
java.lang.UnsupportedOperationException
- if the write was unacknowledged.- See Also:
WriteConcern.UNACKNOWLEDGED
-
getMatchedCount
public abstract int getMatchedCount()
Deprecated.Returns the number of documents matched by updates or replacements in the write operation. This will include documents that matched the query but where the modification didn't result in any actual change to the document; for example, if you set the value of some field, and the field already has that value, that will still count as an update.- Returns:
- the number of documents matched by updates in the write operation
- Throws:
java.lang.UnsupportedOperationException
- if the write was unacknowledged.- See Also:
WriteConcern.UNACKNOWLEDGED
-
getDeletedCount
public abstract int getDeletedCount()
Deprecated.Returns the number of documents deleted by the write operation.- Returns:
- the number of documents deleted by the write operation
- Throws:
java.lang.UnsupportedOperationException
- if the write was unacknowledged.- See Also:
WriteConcern.UNACKNOWLEDGED
-
isModifiedCountAvailable
@Deprecated public abstract boolean isModifiedCountAvailable()
Deprecated.no longer needed since all supported server versions support modified countReturns true if the server was able to provide a count of modified documents.This method now always returns true, as modified count is available since MongoDB 2.6.
- Returns:
- true if modifiedCount is available
- Throws:
java.lang.UnsupportedOperationException
- if the write was unacknowledged.- See Also:
WriteConcern.UNACKNOWLEDGED
,getModifiedCount()
-
getModifiedCount
public abstract int getModifiedCount()
Deprecated.Returns the number of documents modified by the write operation. This only applies to updates or replacements, and will only count documents that were actually changed; for example, if you set the value of some field , and the field already has that value, that will not count as a modification.- Returns:
- the number of documents modified by the write operation
- See Also:
WriteConcern.UNACKNOWLEDGED
-
getUpserts
public abstract java.util.List<BulkWriteUpsert> getUpserts()
Deprecated.Gets an unmodifiable list of upserted items, or the empty list if there were none.- Returns:
- a list of upserted items, or the empty list if there were none.
- Throws:
java.lang.UnsupportedOperationException
- if the write was unacknowledged.- See Also:
WriteConcern.UNACKNOWLEDGED
-
acknowledged
public static BulkWriteResult acknowledged(WriteRequest.Type type, int count, java.util.List<BulkWriteUpsert> upserts)
Deprecated.Create an acknowledged BulkWriteResult- Parameters:
type
- the type of the writecount
- the number of documents matchedupserts
- the list of upserts- Returns:
- an acknowledged BulkWriteResult
-
acknowledged
public static BulkWriteResult acknowledged(WriteRequest.Type type, int count, java.lang.Integer modifiedCount, java.util.List<BulkWriteUpsert> upserts)
Deprecated.Create an acknowledged BulkWriteResult- Parameters:
type
- the type of the writecount
- the number of documents matchedmodifiedCount
- the number of documents modified, which may be null if the server was not able to provide the countupserts
- the list of upserts- Returns:
- an acknowledged BulkWriteResult
-
acknowledged
public static BulkWriteResult acknowledged(int insertedCount, int matchedCount, int removedCount, java.lang.Integer modifiedCount, java.util.List<BulkWriteUpsert> upserts)
Deprecated.Create an acknowledged BulkWriteResult- Parameters:
insertedCount
- the number of documents inserted by the write operationmatchedCount
- the number of documents matched by the write operationremovedCount
- the number of documents removed by the write operationmodifiedCount
- the number of documents modified, which may not be nullupserts
- the list of upserts- Returns:
- an acknowledged BulkWriteResult
-
unacknowledged
public static BulkWriteResult unacknowledged()
Deprecated.Create an unacknowledged BulkWriteResult- Returns:
- an unacknowledged BulkWriteResult
-
-