createIndex

abstract suspend fun createIndex(key: Bson): String

Creates an index.

Return

the name of the created index

Parameters

key

an object describing the index key(s), which may not be null.


abstract suspend fun createIndex(key: Bson, options: IndexOptions): String

Creates an index.

Return

the name of the created index

Parameters

key

an object describing the index key(s), which may not be null.

options

the options for the index


abstract suspend fun createIndex(clientSession: ClientSession, key: Bson): String

Creates an index.

Return

the name of the created index

Since

3.6

Parameters

clientSession

the client session with which to associate this operation

key

an object describing the index key(s), which may not be null.


abstract suspend fun createIndex(    clientSession: ClientSession,     key: Bson,     options: IndexOptions): String

Creates an index.

Return

the name of the created index

Since

3.6

Parameters

clientSession

the client session with which to associate this operation

key

an object describing the index key(s), which may not be null.

options

the options for the index