Class MongoIndexConflictResolver

java.lang.Object
dev.getelements.elements.dao.mongo.provider.MongoIndexConflictResolver
All Implemented Interfaces:
IndexConflictResolver

public class MongoIndexConflictResolver extends Object implements IndexConflictResolver
  • Constructor Details

    • MongoIndexConflictResolver

      public MongoIndexConflictResolver()
  • Method Details

    • resolve

      public boolean resolve(com.mongodb.client.MongoCollection<?> collection, com.mongodb.MongoCommandException cause)
      Description copied from interface: IndexConflictResolver
      Attempts to resolve the given index conflict on collection.
      Specified by:
      resolve in interface IndexConflictResolver
      Parameters:
      collection - the collection on which the conflicting index create was attempted
      cause - the exception raised by the attempted index creation
      Returns:
      true if a conflicting index was identified and dropped; false if cause is not a recognized index-conflict error, or the conflicting index name could not be determined