首页 > 解决方案 > How do I cursor paginate (skip and limit after a specific ID) using aggregation in MongoDB?

问题描述

Instead of using $skip and $limit to jump to an index #, I'd like to skip past a specified _id using aggregate().

Example: let's say I have a list of items that are sorted by date. The first result would be limited by 10. The second query would take in the last _id of the previous result and skip past that _id. Is that possible?

标签: databasemongodb

解决方案


推荐阅读