get

suspend fun <T : Model> get(id: String, collection: MongoCollection<T>, serializer: KSerializer<T>, getData: suspend MongoCollection<T>.() -> T?): T?

Get A single item from your db or cache

Parameters

collection

is the mongo collection you wan to perform action on

serializer

is required to deserialize your object properly

getData

a context receiver that provides the collection for making query