Example usage for org.springframework.data.mongodb.core MongoOperations indexOps

List of usage examples for org.springframework.data.mongodb.core MongoOperations indexOps

Introduction

In this page you can find the example usage for org.springframework.data.mongodb.core MongoOperations indexOps.

Prototype

IndexOperations indexOps(Class<?> entityClass);

Source Link

Document

Returns the operations that can be performed on indexes

Usage

From source file:org.tylproject.data.mongo.MongoModelConfig.java

public static void createIndexes(MongoOperations mongoOps) {
    mongoOps.indexOps(Party.class).ensureIndex(new Index().on("code", Sort.Direction.ASC));
    mongoOps.indexOps(Party.class)
            .ensureIndex(new Index().on("partyIdentifier.identifier", Sort.Direction.ASC));
}