是否有使用 Dynomoose.js 使用 Angular 实现分页的良好实践。我想使用 scan.limit() 从数据库中获取一些电影,例如 20。如何获得第二次扫描 20-40 电影和 40-60 电影?我应该使用 scan.startAt(key) 来检索更多数据吗?
exports.listing = (req, res, next) => {
MoviesModel.scan()
.exec()
.then(movies=> {
if(movies.lastKey){
MovieModel.scan().startAt(movies.lastKey).exec(function(err, movies){
res.json(movies);
});
}
})
.catch(err => next(err));
};