I have to write a complex mongo query using java but am not able to do it.
The mongo query looks like this:
db.video.findOne( {
$or: [
{ key1: { $in : [764] } },
{ key2: {$in : [list2] } },
{ $and [ { key2 : 3}, {key4:67} ] }
]
})
I have to write the above query using the QueryBuilder class. In what way can I do it?
Thanks
I had the same problem and i got a solution in another way :
Using QueryBuilder your query should look like this
Consider using jongo (an API over mongo-java-driver) you can simply copy/paste queries from the shell :