public async Task InsertOneAsync()
 {
     var collection = GetAddCollection();
     var document   = new CustomMongoDB2_6Entity {
         Id = new ObjectId(), Name = "Fred 'Async' Flintstone"
     };
     await collection.InsertOneAsync(document);
 }
        public void InsertOne()
        {
            var collection = GetAddCollection();
            var document   = new CustomMongoDB2_6Entity {
                Id = new ObjectId(), Name = "Fred Flintstone"
            };

            collection.InsertOne(document);
        }
        public async Task <DeleteResult> DeleteOneAsync()
        {
            var collection = GetAddCollection();
            var document   = new CustomMongoDB2_6Entity {
                Id = new ObjectId(), Name = "Barney 'Async' Rubble"
            };

            collection.InsertOne(document);

            var filter = Builders <CustomMongoDB2_6Entity> .Filter.Eq("name", "Barney 'Async' Rubble");

            var result = await collection.DeleteOneAsync(filter);

            return(result);
        }
        public async Task <UpdateResult> UpdateOneAsync()
        {
            var collection = GetAddCollection();
            var document   = new CustomMongoDB2_6Entity {
                Id = new ObjectId(), Name = "Dino Flintstone"
            };

            collection.InsertOne(document);

            var filter = Builders <CustomMongoDB2_6Entity> .Filter.Eq("name", "Dino 'Async' Flintstone");

            var update = Builders <CustomMongoDB2_6Entity> .Update.Set("name", "Dinosaur 'Async' Flintstone");

            var result = await collection.UpdateOneAsync(filter, update);

            return(result);
        }