Package org.kiwiproject.spring.data
Class KiwiMongoIndexes
- java.lang.Object
-
- org.kiwiproject.spring.data.KiwiMongoIndexes
-
public class KiwiMongoIndexes extends Object
Utilities related to Mongo indexes.
-
-
Constructor Summary
Constructors Constructor Description KiwiMongoIndexes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidensureIndices(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, Class<?> clazz, org.springframework.data.domain.Sort.Direction direction, String... properties)Ensure indexes exist for the given collection (defined byclazz), sort direction, and properties.static voidensureIndices(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, String collectionName, org.springframework.data.domain.Sort.Direction direction, String... properties)Ensure indexes exist for the given collection, sort direction, and properties.
-
-
-
Method Detail
-
ensureIndices
public static void ensureIndices(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, Class<?> clazz, org.springframework.data.domain.Sort.Direction direction, String... properties)Ensure indexes exist for the given collection (defined byclazz), sort direction, and properties.- Parameters:
mongoTemplate- the MongoTemplate instanceclazz- the entity/document class representing the mapped MongoDB collectiondirection- the sort direction for all specified propertiesproperties- the properties for which to add an index- See Also:
IndexOperations.ensureIndex(IndexDefinition)
-
ensureIndices
public static void ensureIndices(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate, String collectionName, org.springframework.data.domain.Sort.Direction direction, String... properties)Ensure indexes exist for the given collection, sort direction, and properties.- Parameters:
mongoTemplate- the MongoTemplate instancecollectionName- the MongoDB collection namedirection- the sort direction for all specified propertiesproperties- the properties for which to add an index- See Also:
IndexOperations.ensureIndex(IndexDefinition)
-
-