List of usage examples for com.mongodb.async.client MongoCollection find
FindIterable<TDocument> find(ClientSession clientSession, Bson filter);
From source file:io.vertx.ext.mongo.impl.MongoClientImpl.java
License:Open Source License
private FindIterable<JsonObject> doFind(String collection, WriteOption writeOption, JsonObject query, FindOptions options) {/* ww w .j av a 2 s. co m*/ MongoCollection<JsonObject> coll = getCollection(collection, writeOption); Bson bquery = wrap(encodeKeyWhenUseObjectId(query)); FindIterable<JsonObject> find = coll.find(bquery, JsonObject.class); if (options.getLimit() != -1) { find.limit(options.getLimit()); } if (options.getSkip() > 0) { find.skip(options.getSkip()); } if (options.getSort() != null) { find.sort(wrap(options.getSort())); } if (options.getFields() != null) { find.projection(wrap(options.getFields())); } return find; }