I looked at the documentation of vert.x for MongoDB queries but I couldn't find any examples for how to do more complicated queries such as one that includes regex.
For example :
"name":{$regex:".*bla.*"}
Help appreciated.
I looked at the documentation of vert.x for MongoDB queries but I couldn't find any examples for how to do more complicated queries such as one that includes regex.
For example :
"name":{$regex:".*bla.*"}
Help appreciated.
To find queries example, I guess that the Mongo DB documentation is the place to go. The Vertx docs for MongoClient tells you how to use the client, but queries are Mongo DB queries.
Hope this will help.
I came across this thread when searching an answer for my own query.
The value {$regex : ".*bla.*"} can be viewed as a JSON Object. You can create a JSON Object accordingly and insert that as a value for name field.
JsonObject queryParam = new JsonObject()
.put("name", new JsonObject().put("$regex", ".*bla.*"));
mongoClient.find("collection", queryParam, async -> {
// Do something
});