Created
February 16, 2016 15:58
-
-
Save evanchooly/9d3ab75d5269e994c6d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MongoClient client = MongoClients.create(MongoClientSettings.builder() | |
.clusterSettings(ClusterSettings.builder().hosts(Collections.singletonList(new ServerAddress("localhost"))).build()) | |
.writeConcern(WriteConcern.UNACKNOWLEDGED).build()); | |
System.out.println(client.getSettings().getWriteConcern()); | |
client.getDatabase("test").getCollection("writeConcernTest").insertOne(new Document(), (result, t) -> System.out.println("DONE!")); | |
Thread.sleep(Long.MAX_VALUE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment