kmongo / org.litote.kmongo / com.mongodb.client.MongoCollection / findOneById

findOneById

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

Finds the document that match the id parameter.

Parameters

id - the object id

Return
the first item returned or null

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

Finds the document that match the id parameter.

Parameters

clientSession - the client session with which to associate this operation

id - the object id

Return
the first item returned or null