public static IEnumerable <WriteModel <TDocument> > CreateMongoBulk(MongoDocumentFilterBuilder <TDocument> filterBuilder, Action <IDocumentBulkBuilder <TDocument> > requests)
        {
            var builder = new MongoDocumentBulkBuilderGeneric <TDocument>(filterBuilder);

            requests?.Invoke(builder);

            return(builder._operations);
        }
        public async Task <DocumentBulkResult> BulkAsync(Action <IDocumentBulkBuilder <TDocument> > requests, bool isOrdered = false)
        {
            var bulk = MongoDocumentBulkBuilderGeneric <TDocument> .CreateMongoBulk(_filterBuilder, requests);

            var result = await _collection.Value.BulkWriteAsync(bulk, new BulkWriteOptions { IsOrdered = isOrdered });

            return(new DocumentBulkResult(result.RequestCount, result.MatchedCount, result.InsertedCount, result.ModifiedCount, result.DeletedCount));
        }