How can I use OR and AND clause in Sailsjs and its ORM Waterline? For example I have a table of books
_______________________________________
| book_name | author | free | public |
_______________________________________
| Book-A | Author-1 | false | true |
---------------------------------------
| Book-B | Author-1 | true | true |
---------------------------------------
| Book-C | Author-1 | false | false |
---------------------------------------
| Book-D | Author-2 | true | true |
---------------------------------------
I want to get Books by Author-1 which are either public or free, which is Book-A and Book-B. How do I write this query with Sails.js
The following query should also work:
For doing so we can use the where api of Waterline, following is an example