Method FindSync
FindSync<TProjection>(FilterDefinition<TDocument>, FindOptions<TDocument, TProjection>, CancellationToken)
Finds the documents matching the filter.
IAsyncCursor<TProjection> FindSync<TProjection>(FilterDefinition<TDocument> filter, FindOptions<TDocument, TProjection> options = null, CancellationToken cancellationToken = default)
Parameters
filterFilterDefinition<TDocument>The filter.
optionsFindOptions<TDocument, TProjection>The options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- IAsyncCursor<TProjection>
A cursor.
Type Parameters
TProjectionThe type of the projection (same as TDocument if there is no projection).
FindSync<TProjection>(IClientSessionHandle, FilterDefinition<TDocument>, FindOptions<TDocument, TProjection>, CancellationToken)
Finds the documents matching the filter.
IAsyncCursor<TProjection> FindSync<TProjection>(IClientSessionHandle session, FilterDefinition<TDocument> filter, FindOptions<TDocument, TProjection> options = null, CancellationToken cancellationToken = default)
Parameters
sessionIClientSessionHandleThe session.
filterFilterDefinition<TDocument>The filter.
optionsFindOptions<TDocument, TProjection>The options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- IAsyncCursor<TProjection>
A cursor.
Type Parameters
TProjectionThe type of the projection (same as TDocument if there is no projection).