Class CoreSyncFindIterableImpl<DocumentT,ResultT>
- java.lang.Object
-
- com.mongodb.stitch.core.services.mongodb.remote.sync.internal.CoreSyncMongoIterableImpl<SyncOperations<DocumentT>,ResultT>
-
- com.mongodb.stitch.core.services.mongodb.remote.sync.internal.CoreSyncFindIterableImpl<DocumentT,ResultT>
-
- All Implemented Interfaces:
CoreRemoteMongoIterable<ResultT>
,CoreSyncFindIterable<ResultT>
,Iterable<ResultT>
public class CoreSyncFindIterableImpl<DocumentT,ResultT> extends CoreSyncMongoIterableImpl<SyncOperations<DocumentT>,ResultT> implements CoreSyncFindIterable<ResultT>
-
-
Method Summary
Modifier and Type Method Description CoreSyncFindIterableImpl<DocumentT,ResultT>
filter(Bson filter)
Sets the query filter to apply to the query.ResultT
first()
Helper to return the first item in the iterator or null.CoreSyncFindIterableImpl<DocumentT,ResultT>
limit(int limit)
Sets the limit to apply.CoreSyncFindIterableImpl<DocumentT,ResultT>
projection(Bson projection)
Sets a document describing the fields to return for all matching documents.CoreSyncFindIterableImpl<DocumentT,ResultT>
sort(Bson sort)
Sets the sort criteria to apply to the query.-
Methods inherited from class com.mongodb.stitch.core.services.mongodb.remote.sync.internal.CoreSyncMongoIterableImpl
forEach, into, iterator, map
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.mongodb.stitch.core.services.mongodb.remote.internal.CoreRemoteMongoIterable
forEach, into, iterator, map
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
filter
public CoreSyncFindIterableImpl<DocumentT,ResultT> filter(@Nullable Bson filter)
Sets the query filter to apply to the query.- Specified by:
filter
in interfaceCoreSyncFindIterable<DocumentT>
- Parameters:
filter
- the filter, which may be null.- Returns:
- this
-
limit
public CoreSyncFindIterableImpl<DocumentT,ResultT> limit(int limit)
Sets the limit to apply.- Specified by:
limit
in interfaceCoreSyncFindIterable<DocumentT>
- Parameters:
limit
- the limit, which may be 0- Returns:
- this
-
projection
public CoreSyncFindIterableImpl<DocumentT,ResultT> projection(@Nullable Bson projection)
Sets a document describing the fields to return for all matching documents.- Specified by:
projection
in interfaceCoreSyncFindIterable<DocumentT>
- Parameters:
projection
- the project document, which may be null.- Returns:
- this
-
sort
public CoreSyncFindIterableImpl<DocumentT,ResultT> sort(@Nullable Bson sort)
Sets the sort criteria to apply to the query.- Specified by:
sort
in interfaceCoreSyncFindIterable<DocumentT>
- Parameters:
sort
- the sort criteria, which may be null.- Returns:
- this
-
first
@Nullable public ResultT first()
Description copied from class:CoreSyncMongoIterableImpl
Helper to return the first item in the iterator or null.- Specified by:
first
in interfaceCoreRemoteMongoIterable<DocumentT>
- Overrides:
first
in classCoreSyncMongoIterableImpl<SyncOperations<DocumentT>,ResultT>
- Returns:
- T the first item or null.
-
-