0

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!

user2297996
  • 1,382
  • 3
  • 18
  • 28
  • What adapter are you using? – matth Nov 15 '13 at 20:20
  • as making3 mentioned need to know which adapter you're using. with that said you can view my modified source for a few of the adapters which adds additional methods such as a LIKE. use at own risk. these are specific to our framework that uses jugglingdb. https://github.com/chazelton/xipframe/tree/master/fixup/node_modules – origin1tech Nov 17 '13 at 20:10

1 Answers1

0

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