Class IndexInfo
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
ConstructorDescriptionIndexInfo
(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 TypeMethodDescriptionboolean
Optional<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.int
hashCode()
static IndexInfo
indexInfoOf
(org.bson.Document sourceDocument) Creates newIndexInfo
parsing required properties from the given sourceDocument.boolean
isHashed()
boolean
isHidden()
boolean
isIndexForFields
(Collection<String> keys) Returns whether the index is covering exactly the fields given independently of the order.boolean
isSparse()
boolean
isUnique()
boolean
toString()
-
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 newIndexInfo
parsing 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:
empty
if 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
-