文件名称:mongoose-range-paginate:MongoDb Mongoose 分页正确完成
文件大小:5KB
文件格式:ZIP
更新时间:2024-07-13 06:15:20
JavaScript
MongoDb / Mongoose 分页正确完成 使用范围分页的实用函数,比使用skip()快得多。 安装 $ npm install mongoose-range-paginate 例子 var paginate = require ( 'mongoose-range-paginate' ) . . . // use any field name in your model, in this case we sort by 'timestamp' var sortKey = 'timestamp' // DESC because starts with a minus '-timestamp' var sort = '-' + sortKey function getQuery ( ) { return Posts . find ( ) . where ( { tag
【文件预览】:
mongoose-range-paginate-master
----.travis.yml(111B)
----index.js(1KB)
----test.js(6KB)
----package.json(904B)
----fixtures.js(448B)
----.gitignore(21B)
----README.md(4KB)