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

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

Introduction

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

Prototype

ListIndexesIterable<Document> listIndexes(ClientSession clientSession);

Source Link

Document

Get all the indexes in this collection.

Usage

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

License:Open Source License

@Override
public io.vertx.ext.mongo.MongoClient listIndexes(String collection,
        Handler<AsyncResult<JsonArray>> resultHandler) {
    requireNonNull(collection, "collection cannot be null");
    requireNonNull(resultHandler, "resultHandler cannot be null");
    MongoCollection<JsonObject> coll = getCollection(collection);
    ListIndexesIterable indexes = coll.listIndexes(JsonObject.class);
    if (indexes != null) {
        convertMongoIterable(indexes, resultHandler);
    }//from  ww w . j av  a 2  s .co  m
    return this;
}