【发布时间】:2021-06-29 11:37:03
【问题描述】:
我正在使用 Knex.js 和 Objection.js,我想显示国家/地区下拉列表,所以我需要所有行,但它只返回 10 行。如何覆盖分页功能?
我可以在 url localhost:3031/countires?pages='All' 中设置任何参数吗,应该有一些简单的方法。我正在使用 "knex": "^0.21.1", "objection": "^1.6.11" 版本。 default.js 包含
"paginate": {
"default": 10,
"max": 2000
},
暂时我只是在 src\services\countries\countires.services.js 中进行了以下更改
module.exports = function (app) {
const options = {
Model: createModel(app),
//paginate: app.get("paginate"),
paginate: {
default: 0,
max: 0,
},
};
// Initialize our service with any options it requires
app.use("/countries", new Countries(options, app));
【问题讨论】:
标签: knex.js objection.js