java.lang.Object
org.springframework.data.mongodb.core.index.IndexOptions
Changeable properties of an index. Can be used for index creation and modification.
- Since:
- 4.1
- Author:
- Christoph Strobl
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IndexOptionsexpireAfter(Duration duration) static IndexOptionshidden()isHidden()static IndexOptionsnone()voidvoidsetHidden(boolean hidden) voidsetUnique(IndexOptions.Unique unique) org.bson.Documentstatic IndexOptionsunique()
-
Constructor Details
-
IndexOptions
public IndexOptions()
-
-
Method Details
-
none
- Returns:
- new empty instance of
IndexOptions.
-
unique
- Returns:
- new instance of
IndexOptionshaving theIndexOptions.Unique.YESflag set.
-
expireAfter
- Returns:
- new instance of
IndexOptionswith given expiration.
-
getExpire
- Returns:
- the expiration time. A
negative valuerepresents no expiration, null if not set.
-
setExpire
- Parameters:
expire- must not be null.
-
isHidden
- Returns:
- true if hidden, null if not set.
-
setHidden
public void setHidden(boolean hidden) - Parameters:
hidden-
-
getUnique
- Returns:
- the unique property value, null if not set.
-
setUnique
- Parameters:
unique- must not be null.
-
toDocument
public org.bson.Document toDocument()- Returns:
- the store native representation
-