Package io.realm.mongodb.mongo.options
Class FindOptions
- java.lang.Object
-
- io.realm.mongodb.mongo.options.FindOptions
-
public class FindOptions extends Object
The options to apply to a find operation (also commonly referred to as a query).
-
-
Constructor Summary
Constructors Constructor Description FindOptions()
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLimit()
Gets the limit to apply.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.FindOptions
limit(int limit)
Sets the limit to apply.FindOptions
projection(Bson projection)
Sets a document describing the fields to return for all matching documents.FindOptions
sort(Bson sort)
Sets the sort criteria to apply to the query.String
toString()
-
-
-
Method Detail
-
getLimit
public int getLimit()
Gets the limit to apply. The default is null.- Returns:
- the limit
-
limit
public FindOptions limit(int limit)
Sets the limit to apply.- Parameters:
limit
- the limit, which may be null- Returns:
- this
-
getProjection
@Nullable public Bson getProjection()
Gets a document describing the fields to return for all matching documents.- Returns:
- the project document, which may be null
-
projection
public FindOptions projection(@Nullable 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
-
getSort
@Nullable 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
-
sort
public FindOptions sort(@Nullable Bson sort)
Sets the sort criteria to apply to the query.- Parameters:
sort
- the sort criteria, which may be null.- Returns:
- this
-
-