Posts Query

Overview

Posts Query API is capable of the following items:

  • Search all posts on the server that match the criteria

  • Scoped searching

  • Post types filtering

  • Deleted or non-deleted state filtering

  • Results ordering

Search and Results Behavior

Posts Query API searches all the posts in the database. Any posts that match the criteria will be put into the live collection, regardless of whether it is a parent or a child post.

Posts Query API returns a live collection, with the flattened post objects. The collection can contain parent and child posts, ordered by the sorting criteria.

Use-cases

Posts Query API can be useful for the use-cases that require flattening the search and results. For example:

  • Media gallery that shows the list of all images, posted by a user

  • List of all the text posts that are deleted in a community

The number of items in each page is 20 but can be specified by the pageSize. To handle pagination to load more posts, simply call the fetchNextPage function.

The currently supported query post types are "video", "image" and "file".

Last updated