My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How to develop cursor based pagination with mongoose like twitter APIs?

Anuj Sharma's photo
Anuj Sharma
·Feb 16, 2017

I want to make service for fetching all users list in mongoose. And the retrieve json should be.

  {
  data:[{},{}],
  nextUrl:'/find-user/2/'},
  next:true
    }
  And If next data not be there so then it should be..
  {
  data:[{},{}],
  nextUrl:'/find-user/2/'},
  next:false
  }

Lots of thanks in advance.