Method FindSync
| MongoDB CSharp Driver API Reference (original) (raw)
Namespace
Assembly
MongoDB.Driver.dll
FindSync(IMongoCollection, FilterDefinition, FindOptions<TDocument, TDocument>, CancellationToken)
Finds the documents matching the filter.
public static IAsyncCursor<TDocument> FindSync<TDocument>(this IMongoCollection<TDocument> collection, FilterDefinition<TDocument> filter, FindOptions<TDocument, TDocument> options = null, CancellationToken cancellationToken = default)Parameters
collection IMongoCollection
The collection.
filter FilterDefinition
The filter.
options FindOptions<TDocument, TDocument>
The options.
cancellationToken CancellationToken
The cancellation token.
Returns
A Task whose result is a cursor.
Type Parameters
TDocument
The type of the document.
FindSync(IMongoCollection, Expression<Func<TDocument, bool>>, FindOptions<TDocument, TDocument>, CancellationToken)
Finds the documents matching the filter.
public static IAsyncCursor<TDocument> FindSync<TDocument>(this IMongoCollection<TDocument> collection, Expression<Func<TDocument, bool>> filter, FindOptions<TDocument, TDocument> options = null, CancellationToken cancellationToken = default)Parameters
collection IMongoCollection
The collection.
filter Expression<Func<TDocument, bool>>
The filter.
options FindOptions<TDocument, TDocument>
The options.
cancellationToken CancellationToken
The cancellation token.
Returns
A Task whose result is a cursor.
Type Parameters
TDocument
The type of the document.
FindSync(IMongoCollection, IClientSessionHandle, FilterDefinition, FindOptions<TDocument, TDocument>, CancellationToken)
Finds the documents matching the filter.
public static IAsyncCursor<TDocument> FindSync<TDocument>(this IMongoCollection<TDocument> collection, IClientSessionHandle session, FilterDefinition<TDocument> filter, FindOptions<TDocument, TDocument> options = null, CancellationToken cancellationToken = default)Parameters
collection IMongoCollection
The collection.
session IClientSessionHandle
The session.
filter FilterDefinition
The filter.
options FindOptions<TDocument, TDocument>
The options.
cancellationToken CancellationToken
The cancellation token.
Returns
A Task whose result is a cursor.
Type Parameters
TDocument
The type of the document.
FindSync(IMongoCollection, IClientSessionHandle, Expression<Func<TDocument, bool>>, FindOptions<TDocument, TDocument>, CancellationToken)
Finds the documents matching the filter.
public static IAsyncCursor<TDocument> FindSync<TDocument>(this IMongoCollection<TDocument> collection, IClientSessionHandle session, Expression<Func<TDocument, bool>> filter, FindOptions<TDocument, TDocument> options = null, CancellationToken cancellationToken = default)Parameters
collection IMongoCollection
The collection.
session IClientSessionHandle
The session.
filter Expression<Func<TDocument, bool>>
The filter.
options FindOptions<TDocument, TDocument>
The options.
cancellationToken CancellationToken
The cancellation token.
Returns
A Task whose result is a cursor.
Type Parameters
TDocument
The type of the document.