Class IndexOptions
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IndexOptions
expireAfter
(Duration duration) static IndexOptions
hidden()
isHidden()
static IndexOptions
none()
void
void
setHidden
(boolean hidden) void
setUnique
(IndexOptions.Unique unique) org.bson.Document
static IndexOptions
unique()
-
Constructor Details
-
IndexOptions
public IndexOptions()
-
-
Method Details
-
none
- Returns:
- new empty instance of
IndexOptions
.
-
unique
- Returns:
- new instance of
IndexOptions
having theIndexOptions.Unique.YES
flag set.
-
expireAfter
- Returns:
- new instance of
IndexOptions
with given expiration.
-
getExpire
- Returns:
- the expiration time. A
negative value
represents 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
-