Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/ /
io.realm.mongodb.mongo.options

Clase FindOneAndModifyOptions

java.lang.Object
io.realm.mongodb.mongo.options.FindOneAndModifyOptions

The options to apply to a findOneAndUpdate, findOneAndReplace, or findOneAndDelete operation (also commonly referred to as findOneAndModify operations).

Constructor and Description
Modificador y Tipo
Método y descripción

public Bson

Gets a document describing the fields to return for all matching documents.

public Bson

Obtiene los criterios de ordenación que se aplicarán a la query.

public booleano

Returns true if the findOneAndModify operation should return the new document.

public booleano

Devuelve verdadero si se debe insertar un nuevo documento si no hay coincidencias con el filtro de consulta.

Bson projection
)

Sets a document describing the fields to return for all matching documents.

boolean returnNewDocument
)

Establezca en verdadero si las operaciones findOneAndModify deben devolver el nuevo documento actualizado.

Bson sort
)

Establece los criterios de ordenación a aplicar en la query.

public String

boolean upsert
)

Set to true if a new document should be inserted if there are no matches to the query filter.

  • Métodos heredados de la clase java.lang.Object: getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

public Bson getProjection ()

Gets a document describing the fields to return for all matching documents.

Devuelve

the project document, which may be null

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.

Devuelve

un documento que describe los criterios de clasificación

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

Devuelve

verdadero si la operación findOneAndModify debe devolver el nuevo documento

public boolean isUpsert ()

Devuelve "verdadero" si se debe insertar un nuevo documento si no hay coincidencias con el filtro de consulta. El valor predeterminado es "falso". Nota: Solo findOneAndUpdate y findOneAndReplace aceptan esta opción.

Devuelve

true si se debe insertar un nuevo documento si no hay coincidencias con el filtro de query

Bson projection
)

Sets a document describing the fields to return for all matching documents.

Parámetros

  • projection - the project document, which may be null.

Devuelve

this

boolean 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

Parámetros

  • returnNewDocument - verdadero si las operaciones findOneAndModify deben devolver el documento actualizado

Devuelve

this

Bson sort
)

Establece los criterios de ordenación a aplicar en la query.

Parámetros

  • sort - los criterios de ordenación, que pueden ser nulos.

Devuelve

this

public String toString ()

Anulaciones

toString en la clase Objeto

boolean upsert
)

Set to true if a new document should be inserted if there are no matches to the query filter.

Parámetros

  • upsert - verdadero si se debe insertar un nuevo documento si no hay coincidencias con el filtro de consulta.

Devuelve

this

Volver

CountOptions

En esta página