public class FindOneAndUpdateOptions extends Object
Constructor and Description |
---|
FindOneAndUpdateOptions() |
Modifier and Type | Method and Description |
---|---|
Object |
getProjection()
Gets a document describing the fields to return for all matching documents.
|
boolean |
getReturnOriginal()
When true, return the original document from before it was updated.
|
Object |
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.
|
FindOneAndUpdateOptions |
projection(Object projection)
Sets a document describing the fields to return for all matching documents.
|
FindOneAndUpdateOptions |
returnOriginal(boolean returnOriginal)
Set whether to return the original document from before it was updated.
|
FindOneAndUpdateOptions |
sort(Object sort)
Sets the sort criteria to apply to the query.
|
FindOneAndUpdateOptions |
upsert(boolean upsert)
Set to true if a new document should be inserted if there are no matches to the query filter.
|
public Object getProjection()
public FindOneAndUpdateOptions projection(Object projection)
projection
- the project document, which may be null. This can be of any type for which a
Codec
is registeredpublic Object getSort()
public FindOneAndUpdateOptions sort(Object sort)
sort
- the sort criteria, which may be null. This can be of any type for which a
Codec
is registeredpublic boolean isUpsert()
public FindOneAndUpdateOptions upsert(boolean upsert)
upsert
- true if a new document should be inserted if there are no matches to the query filterpublic boolean getReturnOriginal()
public FindOneAndUpdateOptions returnOriginal(boolean returnOriginal)
returnOriginal
- set whether to return the original document from before it was updated