techfort / LokiJS

javascript embeddable / in-memory database
http:/techfort.github.io/LokiJS
MIT License
6.73k stars 482 forks source link

I have issue to make $or for tow queries? #867

Closed hamedsbt closed 2 years ago

hamedsbt commented 3 years ago

How to make $or for this tow queries?

find({state: {$eq: "a"}});
find({state: {$eq: "b"}, $loki: {$in: [1,2,3]}});

I tried:

chain.find({
      $or: [
        {
          state: {$eq: "a"}
        },
        {
          state: {$eq: "b"}, $loki: {$in: [1,2,3]}
        }
      ]
    });

But does not works as excepted and all rows with state = a has returned. but I.m sure a row with state:b and $loki:3 is exist.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.