Stream Chat icon

Stream Chat

Server-side Stream Chat operations

User → Query Users

AI-generated

Summary

Query Stream Chat users using MongoDB-style filters to retrieve a list of users matching specified criteria.

Inputs

  • Query Filter — A JSON object to filter users using MongoDB-style queries (e.g., {"name": {"$autocomplete": "john"}}). Leave empty {} to return all users.
  • Limit — The maximum number of user results to return (minimum 1). Defaults to 50.

Output shape

a list of user objects matching the query filter, up to the specified limit

Results are paginated by the limit parameter and filtered server-side using MongoDB query syntax. The output is a JSON array of user records returned from the Stream Chat API.

Examples

Example 1: Find users with names starting with "john"

Set Query Filter to {"name": {"$autocomplete": "john"}} and Limit to 10

Example 2: Retrieve up to 100 users without filters

Set Query Filter to {} and Limit to 100

Discussion