Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ / /

Class FindOptions

On this page

  • io.realm.mongodb.mongo.options
  • Constructors
  • Method Summary
  • Inherited Methods
  • Constructor Detail
  • Method Detail
  • getLimit
  • getProjection
  • getSort
  • limit
  • projection
  • sort
  • toString
java.lang.Object
io.realm.mongodb.mongo.options.FindOptions

The options to apply to a find operation (also commonly referred to as a query).

Constructor and Description

Construct a new instance.

Modifier and Type
Method and Description
public int

Gets the limit to apply.

public Bson

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

public Bson

Gets the sort criteria to apply to the query.

int limit
)

Sets the limit to apply.

Bson projection
)

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

Bson sort
)

Sets the sort criteria to apply to the query.

public String
  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

public FindOptions ()

Construct a new instance.
public int getLimit ()

Gets the limit to apply. The default is null.

Returns

the limit

public Bson getProjection ()

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

Returns

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.

Returns

a document describing the sort criteria

int limit
)

Sets the limit to apply.

Parameters

  • limit - the limit, which may be null

Returns

this

Bson projection
)

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

Parameters

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

Returns

this

public FindOptions sort (
Bson sort
)

Sets the sort criteria to apply to the query.

Parameters

  • sort - the sort criteria, which may be null.

Returns

this

public String toString ()

Overrides

toString in class Object

Back

FindOneAndModifyOptions