Package com.mongodb.client.model
Class ClusteredIndexOptions
java.lang.Object
com.mongodb.client.model.ClusteredIndexOptions
Options for cluster index on a collection.
- Since:
- 4.7
- See Also:
- Since server release
- 5.3
-
Constructor Summary
ConstructorDescriptionClusteredIndexOptions
(Bson key, boolean unique) Construct an instance with the required options. -
Method Summary
-
Constructor Details
-
ClusteredIndexOptions
Construct an instance with the required options.- Parameters:
key
- the index key, which currently must be{_id: 1}
unique
- whether the index entries must be unique, which currently must be true
-
-
Method Details
-
getKey
Gets the index key.- Returns:
- the index key
-
isUnique
public boolean isUnique()Gets whether the index entries must be unique- Returns:
- whether the index entries must be unique
-
getName
Gets the index name- Returns:
- the index name
-
name
Sets the index name- Parameters:
name
- the index name- Returns:
- this
-
toString
-