Neither of your second two examples are valid JSON, because they include nested objects without keys. That's why you're getting the syntax error.
The or
key takes an array of clauses (in the form of valid JSON objects) to "or" together. Try:
or:
[
{
start:
{
'>': new Date(parseInt(req.param('start'))*1000),
'<': new Date(parseInt(req.param('end'))*1000)
},
end:
{
'>': new Date(parseInt(req.param('start'))*1000),
'<': new Date(parseInt(req.param('end'))*1000)
}
},
{
start:
{
'<': new Date(parseInt(req.param('start'))*1000)
},
end:
{
'>': new Date(parseInt(req.param('end'))*1000)
}
}
]
Note that your original (working) example isn't really doing an "OR", since you're only putting one object in the array.