java.lang.Object
org.springframework.data.mongodb.core.index.IndexInfo
Index information for a MongoDB index.
- Author:
- Mark Pollack, Oliver Gierke, Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionIndexInfo(List<IndexField> indexFields, String name, boolean unique, boolean sparse, String language) IndexInfo(List<IndexField> indexFields, String name, boolean unique, boolean sparse, String language, boolean hidden) -
Method Summary
Modifier and TypeMethodDescriptionbooleanOptional<org.bson.Document>Get collation information.Get the duration after which documents within the index expire.Returns the individual index fields of the index.getName()Optional<org.bson.Document>Get wildcardProjection information.inthashCode()static IndexInfoindexInfoOf(org.bson.Document sourceDocument) Creates newIndexInfoparsing required properties from the given sourceDocument.booleanisHashed()booleanisHidden()booleanisIndexForFields(Collection<String> keys) Returns whether the index is covering exactly the fields given independently of the order.booleanisSparse()booleanisUnique()booleantoString()
-
Constructor Details
-
IndexInfo
public IndexInfo(List<IndexField> indexFields, String name, boolean unique, boolean sparse, String language) -
IndexInfo
public IndexInfo(List<IndexField> indexFields, String name, boolean unique, boolean sparse, String language, boolean hidden)
-
-
Method Details
-
indexInfoOf
Creates newIndexInfoparsing required properties from the given sourceDocument.- Parameters:
sourceDocument- never null.- Returns:
- new instance of
IndexInfo. - Since:
- 1.10
-
getIndexFields
Returns the individual index fields of the index.- Returns:
-
isIndexForFields
Returns whether the index is covering exactly the fields given independently of the order.- Parameters:
keys- must not be null.- Returns:
-
getName
-
isUnique
public boolean isUnique() -
isSparse
public boolean isSparse() -
getLanguage
- Returns:
- Since:
- 1.6
-
getPartialFilterExpression
- Returns:
- Since:
- 1.0
-
getCollation
Get collation information.- Returns:
- Since:
- 2.0
-
getWildcardProjection
Get wildcardProjection information.- Returns:
emptyif not set.- Since:
- 3.3
-
getExpireAfter
Get the duration after which documents within the index expire.- Returns:
- the expiration time if set,
Optional.empty()otherwise. - Since:
- 2.2
-
isHashed
public boolean isHashed()- Returns:
- true if a hashed index field is present.
- Since:
- 2.2
-
isWildcard
public boolean isWildcard()- Returns:
- true if a wildcard index field is present.
- Since:
- 3.3
-
isHidden
public boolean isHidden() -
toString
-
hashCode
public int hashCode() -
equals
-