Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * There is no exposed reference from the model to bookshelf (e.g. can't do something like `Ad.Bookshelf.knex`). Need to require the bookshelf instance itself.
- ### Getting count of models matching certain criteria
- ```js
- // select count(*) from "ads" where "classified_id" = 2'
- Ad.where({ classified_id: 2 })
- .query() // <- returns QueryBuild instance
- .count()
- .then(function (count) {
- console.log('\n***', count);
- });
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement