Reputation: 43
How to create a query with reactiveMongo with the operator $or
in order to find document by a field OR an other one. thanks in advance
Upvotes: 1
Views: 357
Reputation: 3599
With BSON syntax:
BSONDocument("$or" -> BSONArray(
BSONDocument("name" -> "JON"),
BSONDocument("surname" -> "Tailor")
))
Upvotes: 1
Reputation: 43
this is the syntax
query = Json.obj(
"$or" -> Json.arr(
Json.obj("distributor.PhoneNb" -> phone),
Json.obj("client.PhoneNb"->phone)
)
)
Upvotes: 0