fun <T> MongoCollection<T>.createIndex(key: String, options: IndexOptions = IndexOptions()): Maybe<String>
(source)
Creates an index. If successful, the callback will be executed with the name of the created index as the result.
key
- an object describing the index key(s)
options
- the options for the index
Return
the index name
fun <T> MongoCollection<T>.createIndex(clientSession: ClientSession, key: String, options: IndexOptions = IndexOptions()): Maybe<String>
(source)
Creates an index. If successful, the callback will be executed with the name of the created index as the result.
clientSession
- the client session
key
- an object describing the index key(s)
options
- the options for the index
Return
the index name