在Nodejs中的OriendDB分页
什么是最好的方式来设置偏移和限制分页与NodeJs与东方或东方npm库? 我通过查询生成器获取一些顶点如下:
db.select() .from('some_class') .limit(20) .all() .then(function (results) { cb(results); });
在这里,我可以把限制,但如何把抵消? 无论是在查询或查询生成器分页将是非常有益的。
使用skip()。 在你的例子中获得第二页:
db.select() .from('some_class') .skip(20) .limit(20) .all() .then(function (results) { cb(results); });