bookshelf-pagemaker

How to add simple Where-clause with bookshelf-pagemaker

感情迁移 提交于 2019-12-02 08:23:47
问题 Using the bookshelf-pagemaker NodeJS Module: https://www.npmjs.com/package/bookshelf-pagemaker https://github.com/bhoriuchi/bookshelf-pagemaker .. I was able to get basic paginate working where it selects all rows from a table. But I am not seeing how to add a WHERE clause to the query. QUESTION: Can someone please share a small example of using bookshelf-pagemaker with search criteria - e.g. SELECT * FROM user WHERE id > 10 ? var Bookshelf = require('bookshelf').mysqlAuth; var pagemaker =

How to add simple Where-clause with bookshelf-pagemaker

痴心易碎 提交于 2019-12-02 07:29:15
Using the bookshelf-pagemaker NodeJS Module: https://www.npmjs.com/package/bookshelf-pagemaker https://github.com/bhoriuchi/bookshelf-pagemaker .. I was able to get basic paginate working where it selects all rows from a table. But I am not seeing how to add a WHERE clause to the query. QUESTION: Can someone please share a small example of using bookshelf-pagemaker with search criteria - e.g. SELECT * FROM user WHERE id > 10 ? var Bookshelf = require('bookshelf').mysqlAuth; var pagemaker = require('bookshelf-pagemaker')(Bookshelf); var UserDAO = Bookshelf.Model.extend({ tableName: 'user' });