且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在风帆和水线中混合使用 AND 和 OR 子句

更新时间:2023-11-30 15:30:34

为此我们可以使用Waterline的where api,下面是一个例子

For doing so we can use the where api of Waterline, following is an example

Book.find().where(  { or : [ { free  : true }, {   public: true  } ] })
            .where( { author : "Author-1" }  )
            .exec( function (err, books) {
            //Books will be an array containing all the books that matches this criteria
            //Some code here
    }