Loopback query filter question

9 views
Skip to first unread message

張凱傑

unread,
Apr 23, 2015, 3:04:14 AM4/23/15
to loopb...@googlegroups.com
In the document on website.
The condition of and / or should be follow a array but second example in object.
I think this is a typo.


My question is:
Which one is correct or both correct?
"and" : [ {"field1" : "foo"},   {"field2": "bar"} , {"hello":"world"} ]

{"and" : [{"and" : [ {"field1" : "foo"},   {"field2": "bar"}], {"hello" : "world"} ]}



Post.find({where: {or: [{title: 'My Post'}, {content: 'Hello'}]}}, 
          function (err, posts) {
            ...
});

{
  "or": {
    "and": [ {"field1""foo"}, {"field2""bar"}  ],
    "field1""morefoo"
   }
}
Reply all
Reply to author
Forward
0 new messages