I have the collection "students" with following documents:
{
"name": "A",
"isAlumni": false,
"info": {
"number": 123456789,
"bloodGroup": "O+"
}
},
{
"name": "B",
"isAlumni": false,
"info": {
"number": 123456789,
"bloodGroup": "B+"
}
},
.
.
.
I am trying to write a redash query that displays students with either name A or B, isAlumni : false, and bloodGroup should be an existing field.
mongoShell query that works:
db.getCollection("students").find({"name": {$in: ["A", "B"]}, "isAlumni": false, "info.bloodGroup": {$exists: true}})
I tried writing it as redash json query:-
{
"collection": "students",
"query" : {
"name": {"$in": ["A", "B"]},
"isAlumni": false,
"info.bloodGroup": {"$exists": true}
}
}
I did go through the MongoDB redash doc, but it wasn't as helpful.
Any help is appreciated.