Class HashedIndex

java.lang.Object
org.springframework.data.mongodb.core.index.HashedIndex
All Implemented Interfaces:
IndexDefinition

public class HashedIndex extends Object implements IndexDefinition
IndexDefinition implementation for MongoDB Hashed Indexes maintaining entries with hashes of the values of the indexed field.
Since:
2.2
Author:
Christoph Strobl
  • Method Details

    • hashed

      public static HashedIndex hashed(String field)
      Creates a new HashedIndex for the given field.
      Parameters:
      field - must not be null nor empty.
      Returns:
      new instance of HashedIndex.
    • getIndexKeys

      public org.bson.Document getIndexKeys()
      Description copied from interface: IndexDefinition
      Get the Document containing properties covered by the index.
      Specified by:
      getIndexKeys in interface IndexDefinition
      Returns:
      never null.
    • getIndexOptions

      public org.bson.Document getIndexOptions()
      Description copied from interface: IndexDefinition
      Get the index properties such as unique,...
      Specified by:
      getIndexOptions in interface IndexDefinition
      Returns:
      never null.