In fact, the problem you are trying to solve is not related to ReactiveMongothe quality of the driver.
For example, you can use the command $regexto search for a string in mongodb as follows:
def coll: JSONCollection = db collection "your_collection"
val nameToFind = "Andrey"
val query = obj("name" -> obj("$regex" -> (".*" + nameToFind + ".*")))
coll.find(query).cursor[JsObject].collect[List]() map {
case objects => Ok(obj("result" -> objects))
}
source
share