Example usage for com.mongodb MongoClient setOptions

List of usage examples for com.mongodb MongoClient setOptions

Introduction

In this page you can find the example usage for com.mongodb MongoClient setOptions.

Prototype

@Deprecated
public void setOptions(final int options) 

Source Link

Document

Set the default query options for reads operations executed on any DBCollection created indirectly from this instance, via a DB instance created from #getDB(String) .

Usage

From source file:com.edgytech.umongo.MongoPanel.java

License:Apache License

public void readWriteOptions(ButtonBase button) {
    MongoClient mongo = getMongoNode().getMongoClient();
    OptionDialog od = UMongo.instance.getGlobalStore().getOptionDialog();
    od.update(mongo.getOptions(), mongo.getWriteConcern(), mongo.getReadPreference());
    if (!od.show()) {
        return;//  w  w w .  j  av a  2 s.  co m
    }
    mongo.setOptions(od.getQueryOptions());
    mongo.setWriteConcern(od.getWriteConcern());
    mongo.setReadPreference(od.getReadPreference());
    refresh();
}