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 supported query post types are video, image, file, liveStream , poll and custom post.

For custom post, follow a namespace like format. Example: "amity.customtype"

Please note that PagedList functions in feed and post repository are being deprecated. They are replaced by PagingData. We may obsolete PagedList functions soon.

Pagination

When querying posts, you cannot set limit, skip, after, first, before, and last parameters. By default, the number of items in each page is 15. To handle pagination to load more posts, refer to Implementing feed pagination.

Last updated