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 | ✅ | ID of the community or user respectively. Use community ID for community posts or user ID for user feed posts. |
targetType | Enum | ✅ | Type of the target, either a particular community (community) or a user feed (user). |
types | Array | ❌ | Available post types: video, image, file, liveStream, poll, and custom. If not specified, returns all post types for the target. |
tags | Array | ❌ | 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 | ❌ | 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 | ❌ | Sort order for results. lastCreated (default) shows most recently created posts first, firstCreated shows earliest created posts first. |
feedType | Enum | ❌ | Type of the feed filter. Possible values: published, reviewing, declined. See Feed Types for details. |
includeMixedStructure | Boolean | ❌ | Mixed media filter. When true, posts with mixed media (combining multiple media types) are included in results when filtering by types. When false (default), only posts with pure single-type structures are returned. See Mixed Media Filtering for details. |
Feed Types
Published Posts
Published Posts
Value:
publishedPosts 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:
reviewingPosts that are pending moderator approval. These posts are only visible to the post author and community moderators until approved.Declined Posts
Declined Posts
Value:
declinedPosts that have been rejected by moderators. These posts are only visible to the post author and community moderators.Mixed Media Filtering
The
includeMixedStructure parameter controls whether posts with mixed media types are included when filtering by specific post types. This is particularly useful when querying for content galleries or type-specific feeds.- Pure Structure: Posts with a single media type (e.g., only images, only videos, only audio files)
- Mixed Structure: Posts combining multiple media types (e.g., images + videos, audio + files, any combination)
- Default Behavior (false)
- Include Mixed (true)
- No Type Filter
When This is ideal for:
includeMixedStructure = false (default), querying for specific types returns only posts with pure single-type structures:- Pure photo galleries
- Type-specific content feeds
- Simplified content categorization
Learn more about post structure types and creating mixed media posts in the Mixed Media Posts guide.
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