I'm currently trying to generate a query from webservice from mongo. I hve something like this
'query' :
{
'startDate':{ '$lte':'2016-04-05T00:00:00.000Z' },
'$or':
[
{ 'endDate': { '$gte': '2016-04-05T00:00:00.000Z' } },
{ 'endDate': { '$exists': false }}
]
}
My question is, is it possitble to add another set of '$or' into this json?
If so how do I do it? (ie. how do i create another $or key inside query)
So it becomes something like this
'query' :
{
'startDate':{ '$lte':'2016-04-05T00:00:00.000Z' },
'$or':
[
{ 'endDate': { '$gte': '2016-04-05T00:00:00.000Z' } },
{ 'endDate': { '$exists': false }}
]
'$or':
[ { <field> : <value>, <field> : <value> } ]
}
Thanks and Regards, Kev