Class FindOneAndModifyOptions
On this page
io.realm.mongodb.mongo.options
The options to apply to a findOneAndUpdate, findOneAndReplace, or findOneAndDelete operation (also commonly referred to as findOneAndModify operations).
Constructors
Constructor and Description |
---|
Method Summary
Modifier and Type | Method and Description |
---|---|
public Bson | Gets a document describing the fields to return for all matching documents. |
public Bson | getSort () Gets the sort criteria to apply to the query. |
public boolean | Returns true if the findOneAndModify operation should return the new document. |
public boolean | isUpsert () Returns true if a new document should be inserted if there are no matches to the query filter. |
public FindOneAndModifyOptions | Sets a document describing the fields to return for all matching documents. |
public FindOneAndModifyOptions | Set to true if findOneAndModify operations should return the new updated document. |
public FindOneAndModifyOptions | Sets the sort criteria to apply to the query. |
public String | toString () |
public FindOneAndModifyOptions | Set to true if a new document should be inserted if there are no matches to the query filter. |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass
,hashCode
,equals
,clone
,toString
,notify
,notifyAll
,wait
,wait
,wait
,finalize
Constructor Detail
public FindOneAndModifyOptions () |
---|
Method Detail
getProjection
public Bson getProjection () |
---|
Gets a document describing the fields to return for all matching documents. Returns the project document, which may be null |
getSort
public Bson getSort () |
---|
Gets the sort criteria to apply to the query. The default is null, which means that the documents will be returned in an undefined order. Returns a document describing the sort criteria |
isReturnNewDocument
public boolean isReturnNewDocument () |
---|
Returns true if the findOneAndModify operation should return the new document. The default is false Note: Only findOneAndUpdate and findOneAndReplace take this options findOneAndDelete will always return the old document Returns true if findOneAndModify operation should return the new document |
isUpsert
public boolean isUpsert () |
---|
Returns true if a new document should be inserted if there are no matches to the query filter. The default is false. Note: Only findOneAndUpdate and findOneAndReplace take this option Returns true if a new document should be inserted if there are no matches to the query filter |
projection
Sets a document describing the fields to return for all matching documents. Parameters
Returns this |
returnNewDocument
Set to true if findOneAndModify operations should return the new updated document. Set to false / leave blank to have these operation return the document before the update. Note: Only findOneAndUpdate and findOneAndReplace take this options findOneAndDelete will always return the old document Parameters
Returns this |
sort
Sets the sort criteria to apply to the query. Parameters
Returns this |
toString
upsert
Set to true if a new document should be inserted if there are no matches to the query filter. Parameters
Returns this |