Example usage for com.mongodb.client MongoCollection dropIndex

List of usage examples for com.mongodb.client MongoCollection dropIndex

Introduction

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

Prototype

void dropIndex(Bson keys);

Source Link

Document

Drops the index given the keys used to create it.

Usage

From source file:io.djigger.collector.accessors.stackref.AbstractAccessor.java

License:Open Source License

private void dropIndex(MongoCollection<Document> collection, Document ttlIndex) {
    collection.dropIndex(ttlIndex.getString("name"));
}

From source file:uk.ac.ebi.eva.dbmigration.mongodb.ExtractAnnotationFromVariant.java

License:Apache License

@ChangeSet(order = "002", id = "dropIndexes", author = "EVA")
public void dropIndexes(MongoDatabase mongoDatabase) {
    final MongoCollection<Document> variantsCollection = mongoDatabase
            .getCollection(databaseParameters.getDbCollectionsVariantsName());
    logger.info("2) drop indexes from annot field from collection {}", variantsCollection.getNamespace());

    variantsCollection.dropIndex(LEGACY_ANNOTATION_CT_SO_INDEX);
    variantsCollection.dropIndex(LEGACY_ANNOTATION_XREF_ID_INDEX);
}