T - the operations result type.@Deprecated public class FindAndReplaceOperation<T> extends BaseFindAndModifyOperation<T>
| Constructor and Description |
|---|
FindAndReplaceOperation(MongoNamespace namespace,
Decoder<T> decoder,
BsonDocument replacement)
Deprecated.
|
FindAndReplaceOperation(MongoNamespace namespace,
WriteConcern writeConcern,
boolean retryWrites,
Decoder<T> decoder,
BsonDocument replacement)
Deprecated.
Construct a new instance.
|
FindAndReplaceOperation(MongoNamespace namespace,
WriteConcern writeConcern,
Decoder<T> decoder,
BsonDocument replacement)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
FindAndReplaceOperation<T> |
bypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)
Deprecated.
Sets the bypass document level validation flag.
|
FindAndReplaceOperation<T> |
collation(Collation collation)
Deprecated.
Sets the collation options
|
FindAndReplaceOperation<T> |
filter(BsonDocument filter)
Deprecated.
Sets the query filter to apply to the query.
|
java.lang.Boolean |
getBypassDocumentValidation()
Deprecated.
Gets the bypass document level validation flag
|
Collation |
getCollation()
Deprecated.
Returns the collation options
|
BsonDocument |
getFilter()
Deprecated.
Gets the query filter.
|
long |
getMaxTime(java.util.concurrent.TimeUnit timeUnit)
Deprecated.
Gets the maximum execution time on the server for this operation.
|
BsonDocument |
getProjection()
Deprecated.
Gets a document describing the fields to return for all matching documents.
|
BsonDocument |
getReplacement()
Deprecated.
Gets the document which will replace the document matching the query filter.
|
BsonDocument |
getSort()
Deprecated.
Gets the sort criteria to apply to the query.
|
boolean |
isReturnOriginal()
Deprecated.
When false, returns the replaced document rather than the original.
|
boolean |
isUpsert()
Deprecated.
Returns true if a new document should be inserted if there are no matches to the query filter.
|
FindAndReplaceOperation<T> |
maxTime(long maxTime,
java.util.concurrent.TimeUnit timeUnit)
Deprecated.
Sets the maximum execution time on the server for this operation.
|
FindAndReplaceOperation<T> |
projection(BsonDocument projection)
Deprecated.
Sets a document describing the fields to return for all matching documents.
|
FindAndReplaceOperation<T> |
returnOriginal(boolean returnOriginal)
Deprecated.
Set to false to return the replaced document rather than the original.
|
FindAndReplaceOperation<T> |
sort(BsonDocument sort)
Deprecated.
Sets the sort criteria to apply to the query.
|
FindAndReplaceOperation<T> |
upsert(boolean upsert)
Deprecated.
Set to true if a new document should be inserted if there are no matches to the query filter.
|
execute, executeAsync, getDecoder, getNamespace, getWriteConcern, isRetryWrites@Deprecated public FindAndReplaceOperation(MongoNamespace namespace, Decoder<T> decoder, BsonDocument replacement)
FindAndReplaceOperation(MongoNamespace, WriteConcern, boolean, Decoder, BsonDocument) insteadnamespace - the database and collection namespace for the operation.decoder - the decoder for the result documents.replacement - the document that will replace the found document.@Deprecated public FindAndReplaceOperation(MongoNamespace namespace, WriteConcern writeConcern, Decoder<T> decoder, BsonDocument replacement)
FindAndReplaceOperation(MongoNamespace, WriteConcern, boolean, Decoder, BsonDocument) insteadnamespace - the database and collection namespace for the operation.writeConcern - the writeConcern for the operationdecoder - the decoder for the result documents.replacement - the document that will replace the found document.public FindAndReplaceOperation(MongoNamespace namespace, WriteConcern writeConcern, boolean retryWrites, Decoder<T> decoder, BsonDocument replacement)
namespace - the database and collection namespace for the operation.writeConcern - the writeConcern for the operationretryWrites - if writes should be retried if they fail due to a network error.decoder - the decoder for the result documents.replacement - the document that will replace the found document.public BsonDocument getReplacement()
public BsonDocument getFilter()
public FindAndReplaceOperation<T> filter(BsonDocument filter)
filter - the query filter, which may be null.public BsonDocument getProjection()
public FindAndReplaceOperation<T> projection(BsonDocument projection)
projection - the project document, which may be null.public long getMaxTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit - the time unit to return the result inpublic FindAndReplaceOperation<T> maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
maxTime - the max timetimeUnit - the time unit, which may not be nullpublic BsonDocument getSort()
public FindAndReplaceOperation<T> sort(BsonDocument sort)
sort - the sort criteria, which may be null.public boolean isReturnOriginal()
public FindAndReplaceOperation<T> returnOriginal(boolean returnOriginal)
returnOriginal - set to false to return the replaced document rather than the originalpublic boolean isUpsert()
public FindAndReplaceOperation<T> upsert(boolean upsert)
upsert - true if a new document should be inserted if there are no matches to the query filterpublic java.lang.Boolean getBypassDocumentValidation()
public FindAndReplaceOperation<T> bypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)
bypassDocumentValidation - If true, allows the write to opt-out of document level validation.public Collation getCollation()
public FindAndReplaceOperation<T> collation(Collation collation)
A null value represents the server default.
collation - the collation options to useCopyright © 2010 - 2023 Adobe. All Rights Reserved