Class MongoDBIndexCreator

java.lang.Object
org.nuxeo.ecm.core.storage.mongodb.MongoDBIndexCreator

public class MongoDBIndexCreator extends Object
Since:
2021.8
  • Field Details

    • handler

      protected final PropertyCharacteristicHandler handler
    • collection

      protected final com.mongodb.client.MongoCollection<org.bson.Document> collection
    • existingIndexes

      protected Map<String,org.bson.Document> existingIndexes
  • Constructor Details

    • MongoDBIndexCreator

      public MongoDBIndexCreator(PropertyCharacteristicHandler handler, com.mongodb.client.MongoCollection<org.bson.Document> collection)
  • Method Details

    • createIndexes

      public void createIndexes(Schema schema)
    • createIndexes

      public void createIndexes(List<com.mongodb.client.model.IndexModel> indexes)
    • pathToIndexKey

      protected String pathToIndexKey(String path)
      Converts the given Nuxeo path to MongoDB identifier.

      For example:

      • dc:title -> dc:title
      • file:content/data -> file:content.data
      • files:files/*/data -> files:files.data
    • toIndexModel

      protected com.mongodb.client.model.IndexModel toIndexModel(PropertyIndexOrder property)
    • getExistingIndexes

      protected Map<String,org.bson.Document> getExistingIndexes()
    • getIndexName

      protected String getIndexName(com.mongodb.client.model.IndexModel index)
    • 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

      protected boolean checkDefinition(Object expectedValue, org.bson.Document actualIndex, String fieldName)
    • checkDefinition

      protected boolean checkDefinition(org.bson.conversions.Bson expectedValue, org.bson.Document actualIndex, String fieldName)