I want to run a query, which returns all elements of a collection, in which
- the fields
wasProposedandmarkedByUserare true and - the field
recipientEmailis either[email protected]or[email protected].
In my Java code, I create a BasicDBObject, whose toString returns this:
{
"wasProposed" : true ,
"recipientEmail" :
{
"$or" :
[
{ "recipientEmail" : "[email protected]" } ,
{ "recipientEmail" : "[email protected]" }
]
},
"markedByUser" : true
}
When I run this query (rcoll.find(query).sort(sortclause).limit(ITEMS_TO_SHOW)), I get the error com.mongodb.MongoException: invalid operator: $or.
How can I modify the query above in order to get rid of this error?