Example usage for com.mongodb.async.client MongoCollection withWriteConcern

List of usage examples for com.mongodb.async.client MongoCollection withWriteConcern

Introduction

In this page you can find the example usage for com.mongodb.async.client MongoCollection withWriteConcern.

Prototype

MongoCollection<TDocument> withWriteConcern(WriteConcern writeConcern);

Source Link

Document

Create a new MongoCollection instance with a different write concern.

Usage

From source file:io.vertx.ext.mongo.impl.MongoClientImpl.java

License:Open Source License

private MongoCollection<JsonObject> getCollection(String name, WriteOption writeOption) {
    MongoCollection<JsonObject> coll = holder.db.getCollection(name, JsonObject.class);
    if (coll != null && writeOption != null) {
        coll = coll.withWriteConcern(WriteConcern.valueOf(writeOption.name()));
    }//from w  w  w  . j a v a  2s  .  c o  m
    return coll;
}