public class FindOneAndReplaceOptions
extends java.lang.Object
Constructor and Description |
---|
FindOneAndReplaceOptions() |
Modifier and Type | Method and Description |
---|---|
FindOneAndReplaceOptions |
bypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)
Sets the bypass document level validation flag.
|
FindOneAndReplaceOptions |
collation(Collation collation)
Sets the collation options
|
java.lang.Boolean |
getBypassDocumentValidation()
Gets the the bypass document level validation flag
|
Collation |
getCollation()
Returns the collation options
|
long |
getMaxTime(java.util.concurrent.TimeUnit timeUnit)
Gets the maximum execution time for the find one and replace operation.
|
Bson |
getProjection()
Gets a document describing the fields to return for all matching documents.
|
ReturnDocument |
getReturnDocument()
Gets the
ReturnDocument value indicating whether to return the document before it was replaced or after |
Bson |
getSort()
Gets the sort criteria to apply to the query.
|
boolean |
isUpsert()
Returns true if a new document should be inserted if there are no matches to the query filter.
|
FindOneAndReplaceOptions |
maxTime(long maxTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
FindOneAndReplaceOptions |
projection(Bson projection)
Sets a document describing the fields to return for all matching documents.
|
FindOneAndReplaceOptions |
returnDocument(ReturnDocument returnDocument)
Set whether to return the document before it was replaced or after
|
FindOneAndReplaceOptions |
sort(Bson sort)
Sets the sort criteria to apply to the query.
|
java.lang.String |
toString() |
FindOneAndReplaceOptions |
upsert(boolean upsert)
Set to true if a new document should be inserted if there are no matches to the query filter.
|
@Nullable public Bson getProjection()
public FindOneAndReplaceOptions projection(@Nullable Bson projection)
projection
- the project document, which may be null.@Nullable public Bson getSort()
public FindOneAndReplaceOptions sort(@Nullable Bson sort)
sort
- the sort criteria, which may be null.public boolean isUpsert()
public FindOneAndReplaceOptions upsert(boolean upsert)
upsert
- true if a new document should be inserted if there are no matches to the query filterpublic ReturnDocument getReturnDocument()
ReturnDocument
value indicating whether to return the document before it was replaced or afterReturnDocument.BEFORE
if returning the document before it was replaced otherwise return ReturnDocument.AFTER
public FindOneAndReplaceOptions returnDocument(ReturnDocument returnDocument)
returnDocument
- set whether to return the document before it was replaced or afterpublic FindOneAndReplaceOptions maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
maxTime
- the max timetimeUnit
- the time unit, which may not be nullpublic long getMaxTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the time unit for the result@Nullable public java.lang.Boolean getBypassDocumentValidation()
public FindOneAndReplaceOptions bypassDocumentValidation(@Nullable java.lang.Boolean bypassDocumentValidation)
bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.@Nullable public Collation getCollation()
public FindOneAndReplaceOptions collation(@Nullable Collation collation)
A null value represents the server default.
collation
- the collation options to usepublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved