findOneById

suspend fun <T : Any> MongoCollection<T>.findOneById(id: Any, clientSession: ClientSession): T?

Finds the document with the specified id.

Parameters

id

the object id

clientSession

the client session with which to associate this operation


suspend fun <T : Any> MongoCollection<T>.findOneById(id: Any): T?

Finds the document that match the id parameter.

Return

the first item returned or null

Parameters

id

the object id


suspend fun <T : Any> MongoCollection<T>.findOneById(clientSession: ClientSession, id: Any): T?

Finds the document that match the id parameter.

Return

the first item returned or null

Parameters

clientSession

the client session with which to associate this operation

id

the object id