/// <summary> /// Returns true if any of the document of the collection matches the filter condition. /// </summary> /// <typeparam name="TDocument">The type representing a Document.</typeparam> /// <typeparam name="TKey">The type of the primary key for a Document.</typeparam> /// <param name="filter">A LINQ expression filter.</param> /// <param name="partitionKey">An optional partition key.</param> /// <param name="cancellationToken">An optional cancellation Token.</param> public async virtual Task <bool> AnyAsync <TDocument, TKey>(Expression <Func <TDocument, bool> > filter, string partitionKey = null, CancellationToken cancellationToken = default) where TDocument : IDocument <TKey> where TKey : IEquatable <TKey> { return(await MongoDbReader.AnyAsync <TDocument, TKey>(filter, partitionKey, cancellationToken)); }
/// <summary> /// Returns true if any of the document of the collection matches the filter condition. /// </summary> /// <typeparam name="TDocument">The type representing a Document.</typeparam> /// <param name="filter">A LINQ expression filter.</param> /// <param name="partitionKey">An optional partition key.</param> public async Task <bool> AnyAsync <TDocument>(Expression <Func <TDocument, bool> > filter, string partitionKey = null) where TDocument : IDocument <TKey> { return(await MongoDbReader.AnyAsync <TDocument, TKey>(filter, partitionKey)); }
/// <summary> /// Returns true if any of the document of the collection matches the filter condition. /// </summary> /// <typeparam name="TDocument">The type representing a Document.</typeparam> /// <typeparam name="TKey">The type of the primary key for a Document.</typeparam> /// <param name="condition">A mongodb filter definition.</param> /// <param name="countOption">A mongodb counting option.</param> /// <param name="partitionKey">An optional partition key.</param> /// <param name="cancellationToken">An optional cancellation Token.</param> public Task <bool> AnyAsync <TDocument, TKey>(FilterDefinition <TDocument> condition, CountOptions countOption = null, string partitionKey = null, CancellationToken cancellationToken = default) where TDocument : IDocument <TKey> where TKey : IEquatable <TKey> { return(MongoDbReader.AnyAsync <TDocument, TKey>(condition, countOption, partitionKey, cancellationToken)); }