Live Collection
Query results are returned as live collections with real-time updates
Flexible Filtering
Filter by post type, target, deletion status, and custom criteria
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
targetId | String | Yes | ID of the community or user respectively. Use community ID for community posts or user ID for user feed posts. |
targetType | Enum | Yes | Type of the target, either a particular community (community ) or a user feed (user ). |
types | Array | No | Available post types: video , image , file , liveStream , poll , and custom . If not specified, returns all post types for the target. |
tags | Array | No | Filter posts by specific tags. When specified, only posts containing these tags will be returned. Useful for content categorization and topic-based filtering. |
includeDeleted | Boolean | No | Deletion filter. When true , retrieves both deleted and non-deleted posts. When false (default), only non-deleted posts are returned. Excludes all deleted posts (both soft and hard deleted) not owned by the logged-in user. Community moderators can see soft-deleted posts in community feeds, while users can see their own soft-deleted posts in their user feeds. |
sortBy | Enum | No | Sort order for results. lastCreated (default) shows most recently created posts first, firstCreated shows earliest created posts first. |
feedType | Enum | No | Type of the feed filter. Possible values: published , reviewing , declined . See Feed Types for details. |
Feed Types
Published Posts
Published Posts
Value:
published
Posts that have been approved and are visible to community members. This is the default state for most posts in communities without review requirements.Reviewing Posts
Reviewing Posts
Value:
reviewing
Posts that are pending moderator approval. These posts are only visible to the post author and community moderators until approved.Declined Posts
Declined Posts
Value:
declined
Posts that have been rejected by moderators. These posts are only visible to the post author and community moderators.Parameter Usage Examples
Community Media Gallery
Community Media Gallery
Use Case: Create a photo gallery showing only images and videos from a specific communityThis query retrieves only image and video posts from community “community-123”, excludes any deleted content, and shows newest posts first.
User's Personal Timeline
User's Personal Timeline
Use Case: Display a user’s complete post history including their own deleted postsThis query shows all post types from the user’s timeline, including their own soft-deleted posts, sorted from oldest to newest.
Moderation Review Queue
Moderation Review Queue
Use Case: Community moderators reviewing pending postsThis query retrieves only posts that are pending review in the community, helping moderators efficiently process approval queues.
Tag-Based Content Discovery
Tag-Based Content Discovery
Use Case: Find posts with specific tags for topic-based content filteringThis query filters for posts tagged with “tutorial”, “beginner”, and “javascript”, perfect for creating topic-specific feeds or educational content discovery.
Advanced Tag Filtering
Advanced Tag Filtering
Use Case: Combine tags with content type filtering for specialized searchesThis query finds visual content (videos and images) tagged with product or feature-related tags, ideal for creating marketing galleries or product showcase feeds.
Archive Access
Archive Access
Use Case: Access declined posts for audit or appeal purposesThis query retrieves declined posts including deleted ones, sorted chronologically for audit trail purposes. Only available to moderators and administrators.
Common Use Cases
Community Feed
Display all posts in a community with real-time updates and customizable filtering options.
User Profile
Show a user’s post history with privacy controls and content type filtering.
Media Gallery
Create image and video galleries by filtering posts with media attachments.
Best Practices
Query Optimization
Query Optimization
- Use specific post types instead of querying all types
- Implement pagination for large result sets
- Cache frequently accessed queries
- Dispose of live collections when no longer needed
User Experience
User Experience
- Show loading states during query execution
- Implement pull-to-refresh for live collections
- Provide empty states for no results
- Use skeleton screens for better perceived performance
Error Handling
Error Handling
- Handle network connectivity issues gracefully
- Implement retry mechanisms for failed queries
- Provide meaningful error messages to users
- Log query errors for debugging purposes
Memory Management
Memory Management
- Dispose of live collections when views are destroyed
- Implement proper lifecycle management
- Use weak references to prevent memory leaks
- Monitor memory usage in production