Package org.graylog2.database.indices
Class MongoDbIndexTools<T>
java.lang.Object
org.graylog2.database.indices.MongoDbIndexTools<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateUniqueIndex(String field) static voidensureTTLIndex(com.mongodb.client.MongoCollection<org.bson.Document> collection, Duration ttl, String fieldUpdatedAt) voidprepareIndices(String idField, Collection<String> sortFields, Collection<String> caseInsensitiveStringSortFields) Prepares indices in MongoDB collection, given proper document fields identifiers.
-
Constructor Details
-
MongoDbIndexTools
-
-
Method Details
-
ensureTTLIndex
-
prepareIndices
public void prepareIndices(String idField, Collection<String> sortFields, Collection<String> caseInsensitiveStringSortFields) Prepares indices in MongoDB collection, given proper document fields identifiers.- Parameters:
idField- Name of id field.sortFields- List of all sortable fields, which need index creation.caseInsensitiveStringSortFields- List of those of sortable fields than need case in-sensitive sorting.
-
createUniqueIndex
-