JugglingDB Mode.all() : how to construct OR query?

404 Views Asked by At

According to docs the first parameter or Model.all() is where, which is an object:

where: Object { key: val, key2: {gt: 'val2'}}

But this is AND relationship, no? How to select "key OR key2"?

Thanks!

1

There are 1 best solutions below

0
On

If you're using the mysql-adapter you can build a query like:

where : {
    or : [ { key1 : val},
           { key2: {gt: val2}}
    ]
}

docs: https://github.com/jugglingdb/mysql-adapter#using-or-and-in-operator