Unsolved How to get all posts !!!

  • Hi,

    I am trying to get all posts of a particular topic but unable to get. I have tried /api/search which returns maximum 500 posts only (10 posts per page) and total page count is 50.Issue is that I have 720 posts in my mongo collections. Is there way to sort it out ?.

    Looking forward for the feedback.


  • NodeBB Admin

    You can use /api/topic/<id>?page=1 and get all the posts page by page. If you want to load all the posts in one call you need to make a call directly to load them with db.getSortedSetRevRange('tid:<tid>:posts', 0, -1);

  • @baris We want to get all posts available in the database, which is 720. However the max count is 500...How can we do it?

  • I've just done it recently.

    1. call /api/topic/pagination/<tid> to get pagination list
    2. for each one call /api/topic/<tid>?<qs>
    3. merge results and it's done.

    It will be nice to have an option like ?page=all ...

Suggested Topics

| | | |