Package com.mongodb.client.model
Class IndexModel
- java.lang.Object
-
- com.mongodb.client.model.IndexModel
-
public class IndexModel extends java.lang.ObjectA model describing the creation of a single index.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description IndexModel(Bson keys)Construct an instance with the given keys.IndexModel(Bson keys, IndexOptions options)Construct an instance with the given keys and options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BsongetKeys()Gets the index keys.IndexOptionsgetOptions()Gets the index options.java.lang.StringtoString()
-
-
-
Constructor Detail
-
IndexModel
public IndexModel(Bson keys)
Construct an instance with the given keys.- Parameters:
keys- the index keys
-
IndexModel
public IndexModel(Bson keys, IndexOptions options)
Construct an instance with the given keys and options.- Parameters:
keys- the index keysoptions- the index options
-
-
Method Detail
-
getKeys
public Bson getKeys()
Gets the index keys.- Returns:
- the index keys
-
getOptions
public IndexOptions getOptions()
Gets the index options.- Returns:
- the index options
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-