private Task <BsonDocument> ExplainCountAsync(CountModel model, ExplainVerbosity verbosity, TimeSpan?timeout, CancellationToken cancellationToken) { var countOperation = CreateCountOperation(model); var explainOperation = countOperation.ToExplainOperation(verbosity.ToCore()); return(ExecuteReadOperation(explainOperation, timeout, cancellationToken)); }
private Task <BsonDocument> ExplainFindAsync <TResult>(FindModel <TResult> model, ExplainVerbosity verbosity, TimeSpan?timeout, CancellationToken cancellationToken) { var findOperation = CreateFindOperation <TResult>(model); var explainOperation = findOperation.ToExplainOperation(verbosity.ToCore()); return(ExecuteReadOperation(explainOperation, timeout, cancellationToken)); }
private Task <BsonDocument> ExplainAggregateAsync <TResult>(AggregateModel <TResult> model, ExplainVerbosity verbosity, TimeSpan?timeout, CancellationToken cancellationToken) { var pipeline = model.Pipeline.Select(x => ConvertToBsonDocument(x)).ToList(); var aggregateOperation = CreateAggregateOperation <TResult>(model, pipeline); var explainOperation = aggregateOperation.ToExplainOperation(verbosity.ToCore()); return(ExecuteReadOperation(explainOperation, timeout, cancellationToken)); }