public class FindOneAndModifyOptions extends Object
Constructor and Description |
---|
FindOneAndModifyOptions() |
Modifier and Type | Method and Description |
---|---|
Bson |
getProjection()
Gets a document describing the fields to return for all matching documents.
|
Bson |
getSort()
Gets the sort criteria to apply to the query.
|
boolean |
isReturnNewDocument()
Returns true if the findOneAndModify operation should return the new document.
|
boolean |
isUpsert()
Returns true if a new document should be inserted if there are no matches to the query filter.
|
FindOneAndModifyOptions |
projection(Bson projection)
Sets a document describing the fields to return for all matching documents.
|
FindOneAndModifyOptions |
returnNewDocument(boolean returnNewDocument)
Set to true if findOneAndModify operations should return the new updated document.
|
FindOneAndModifyOptions |
sort(Bson sort)
Sets the sort criteria to apply to the query.
|
String |
toString() |
FindOneAndModifyOptions |
upsert(boolean upsert)
Set to true if a new document should be inserted if there are no matches to the query filter.
|
public Bson getProjection()
public FindOneAndModifyOptions projection(Bson projection)
projection
- the project document, which may be null.public Bson getSort()
public FindOneAndModifyOptions sort(Bson sort)
sort
- the sort criteria, which may be null.public boolean isUpsert()
public FindOneAndModifyOptions upsert(boolean upsert)
upsert
- true if a new document should be inserted if there are no matches to the query
filter.public boolean isReturnNewDocument()
public FindOneAndModifyOptions returnNewDocument(boolean returnNewDocument)
returnNewDocument
- true if findOneAndModify operations should return the updated document