Using mix of AND and OR clause in sails and waterline

后端 未结 3 1580
没有蜡笔的小新
没有蜡笔的小新 2021-01-14 11:22

How can I use OR and AND clause in Sailsjs and its ORM Waterline? For example I have a table of books

 _______________________________________
| book_name |          


        
3条回答
  •  無奈伤痛
    2021-01-14 11:49

    The following query should also work:

    const books = yield Book.find().where({
      author: 'Author-1',
      or: [{
        free: true,
      }, {
        public: true,
      }],
    });
    

提交回复
热议问题