Class RemoteFindOptions
- java.lang.Object
-
- com.mongodb.stitch.core.services.mongodb.remote.RemoteFindOptions
-
public class RemoteFindOptions extends Object
The options to apply to a find operation (also commonly referred to as a query).
-
-
Constructor Summary
Constructors Constructor Description RemoteFindOptions()Construct a new instance.
-
Method Summary
Modifier and Type Method Description intgetLimit()Gets the limit to apply.BsongetProjection()Gets a document describing the fields to return for all matching documents.BsongetSort()Gets the sort criteria to apply to the query.RemoteFindOptionslimit(int limit)Sets the limit to apply.RemoteFindOptionsprojection(Bson projection)Sets a document describing the fields to return for all matching documents.RemoteFindOptionssort(Bson sort)Sets the sort criteria to apply to the query.StringtoString()
-
-
-
Method Detail
-
getLimit
public int getLimit()
Gets the limit to apply. The default is null.- Returns:
- the limit
-
limit
public RemoteFindOptions 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 RemoteFindOptions 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 RemoteFindOptions sort(@Nullable Bson sort)
Sets the sort criteria to apply to the query.- Parameters:
sort- the sort criteria, which may be null.- Returns:
- this
-
-