fun <T> MongoCollection<T>.createIndex(keys: String, indexOptions: IndexOptions = IndexOptions()): String
(source)
Create an index with the given keys and options.
keys
- an object describing the index key(s), which may not be null.
indexOptions
- the options for the index
Return
the index name
fun <T> MongoCollection<T>.createIndex(clientSession: ClientSession, keys: String, indexOptions: IndexOptions = IndexOptions()): String
(source)
Create an index with the given keys and options.
clientSession
- the client session with which to associate this operation
keys
- an object describing the index key(s), which may not be null.
indexOptions
- the options for the index
Return
the index name