fun <T> MongoCollection<T>.findOne(filter: String = KMongoUtil.EMPTY_JSON): T?
(source)fun <T> MongoCollection<T>.findOne(filter: Bson): T?
(source)
Finds the first document that match the filter in the collection.
Return
the first item returned or null
fun <T> MongoCollection<T>.findOne(vararg filters: Bson?): T?
(source)
Finds the first document that match the filters in the collection.
Return
the first item returned or null
inline fun <reified T : Any> MongoCollection<T>.findOne(filters: () -> Bson): T?
(source)
Finds the first document that match the filter in the collection.
Return
the first item returned or null
fun <T> MongoCollection<T>.findOne(clientSession: ClientSession, filter: String = KMongoUtil.EMPTY_JSON): T?
(source)fun <T> MongoCollection<T>.findOne(clientSession: ClientSession, filter: Bson): T?
(source)
Finds the first document that match the filter in the collection.
clientSession
- the client session with which to associate this operation
Return
the first item returned or null
fun <T> MongoCollection<T>.findOne(clientSession: ClientSession, vararg filters: Bson?): T?
(source)
Finds the first document that match the filters in the collection.
clientSession
- the client session with which to associate this operation
Return
the first item returned or null
inline fun <reified T : Any> MongoCollection<T>.findOne(clientSession: ClientSession, filters: () -> Bson): T?
(source)
Finds the first document that match the filter in the collection.
clientSession
- the client session with which to associate this operation
Return
the first item returned or null