Example usage for com.mongodb ExplainVerbosity QUERY_PLANNER

List of usage examples for com.mongodb ExplainVerbosity QUERY_PLANNER

Introduction

In this page you can find the example usage for com.mongodb ExplainVerbosity QUERY_PLANNER.

Prototype

ExplainVerbosity QUERY_PLANNER

To view the source code for com.mongodb ExplainVerbosity QUERY_PLANNER.

Click Source Link

Document

Runs the query planner and chooses the winning plan, but does not actually execute it.

Usage

From source file:mongofx.js.api.FindResultIterable.java

License:Open Source License

public ObjectListPresentation explain() {
    MongoCollection<Document> collection = getCollection();

    FindIterable findIterable = new FindIterable(new MongoNamespace(mongoDatabase.getName(), collectionName),
            collection.getCodecRegistry(), //
            collection.getReadPreference(), getExecutor(), findQuery, findOptions);

    BsonDocument res = findIterable.explainIterator(ExplainVerbosity.QUERY_PLANNER);
    return JsApiUtils.singletonIter(JsApiUtils.convertBsonToDocument(res));
}