query-engine icon indicating copy to clipboard operation
query-engine copied to clipboard

how to mix $or and $and ?

Open timaschew opened this issue 11 years ago • 0 comments

I want to make a query, something like that: (foo && bar) || (qux && baz) I wrote it in this style (coffee script)

@getDatabase().findAllLive
  $or:
    $and:
      foo: {$exists: true}
      bar: {$exists: true}
    $and:
      qux: {$exists: true}
      baz: {$exists: true}

But the result is always the part with qux && baz

Here is the real query: https://gist.github.com/timaschew/0f53f48a8e82431dccf6

timaschew avatar May 05 '14 17:05 timaschew