Class MongoDBIndexCreator
java.lang.Object
org.nuxeo.ecm.core.storage.mongodb.MongoDBIndexCreator
- Since:
- 2021.8
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.mongodb.client.MongoCollection<org.bson.Document>
protected final PropertyCharacteristicHandler
-
Constructor Summary
ConstructorDescriptionMongoDBIndexCreator
(PropertyCharacteristicHandler handler, com.mongodb.client.MongoCollection<org.bson.Document> collection) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkDefinition
(boolean expectedValue, org.bson.Document actualIndex, String fieldName) protected boolean
checkDefinition
(Object expectedValue, org.bson.Document actualIndex, String fieldName) protected boolean
checkDefinition
(org.bson.conversions.Bson expectedValue, org.bson.Document actualIndex, String fieldName) void
createIndexes
(List<com.mongodb.client.model.IndexModel> indexes) void
createIndexes
(Schema schema) protected String
getIndexName
(com.mongodb.client.model.IndexModel index) protected boolean
hasCorrectDefinition
(com.mongodb.client.model.IndexModel index, org.bson.Document actualIndex) protected String
pathToIndexKey
(String path) Converts the given Nuxeopath
to MongoDB identifier.protected com.mongodb.client.model.IndexModel
toIndexModel
(PropertyIndexOrder property)
-
Field Details
-
handler
-
collection
protected final com.mongodb.client.MongoCollection<org.bson.Document> collection -
existingIndexes
-
-
Constructor Details
-
MongoDBIndexCreator
public MongoDBIndexCreator(PropertyCharacteristicHandler handler, com.mongodb.client.MongoCollection<org.bson.Document> collection)
-
-
Method Details
-
createIndexes
-
createIndexes
-
pathToIndexKey
Converts the given Nuxeopath
to MongoDB identifier.For example:
- dc:title -> dc:title
- file:content/data -> file:content.data
- files:files/*/data -> files:files.data
-
toIndexModel
-
getExistingIndexes
-
getIndexName
-
hasCorrectDefinition
protected boolean hasCorrectDefinition(com.mongodb.client.model.IndexModel index, org.bson.Document actualIndex) -
checkDefinition
protected boolean checkDefinition(boolean expectedValue, org.bson.Document actualIndex, String fieldName) -
checkDefinition
-
checkDefinition
protected boolean checkDefinition(org.bson.conversions.Bson expectedValue, org.bson.Document actualIndex, String fieldName)
-