Method DistinctAsync
DistinctAsync<TField>(FieldDefinition<TDocument, TField>, FilterDefinition<TDocument>, DistinctOptions, CancellationToken)
Gets the distinct values for a specified field.
Task<IAsyncCursor<TField>> DistinctAsync<TField>(FieldDefinition<TDocument, TField> field, FilterDefinition<TDocument> filter, DistinctOptions options = null, CancellationToken cancellationToken = default)
Parameters
field
FieldDefinition <TDocument, TField>The field.
filter
FilterDefinition <TDocument>The filter.
options
DistinctOptions The options.
cancellationToken
CancellationToken The cancellation token.
Returns
- Task<IAsync
Cursor <TField>> A Task whose result is a cursor.
Type Parameters
TField
The type of the result.
DistinctAsync<TField>(IClientSessionHandle, FieldDefinition<TDocument, TField>, FilterDefinition<TDocument>, DistinctOptions, CancellationToken)
Gets the distinct values for a specified field.
Task<IAsyncCursor<TField>> DistinctAsync<TField>(IClientSessionHandle session, FieldDefinition<TDocument, TField> field, FilterDefinition<TDocument> filter, DistinctOptions options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSession Handle The session.
field
FieldDefinition <TDocument, TField>The field.
filter
FilterDefinition <TDocument>The filter.
options
DistinctOptions The options.
cancellationToken
CancellationToken The cancellation token.
Returns
- Task<IAsync
Cursor <TField>> A Task whose result is a cursor.
Type Parameters
TField
The type of the result.