findOneById

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


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