Skip to content
Platform docs
Auth, users, webhooks & more
Info:
This is beta documentation for Stream Video React SDK v2. For the latest stable version, see the latest version (v1).

Querying Call Members

Creating or joining a call returns up to 100 members (default 25). For complete member lists, use the query API with pagination, filtering, and sorting.

await call.getOrCreate({ members_limit: 100 });
// or
await call.join({ members_limit: 100 });

Best Practices

  • Use pagination for calls with many members to avoid loading all data at once.
  • Filter by role to quickly find hosts, moderators, or specific participant types.
  • Use sorting to present members in a consistent order.
  • Cache results when appropriate to reduce API calls.

Examples

Below are a few examples of how to use this API:

const result = await call.queryMembers();

// sorting and pagination
const queryMembersReq = {
  sort: [{ field: "user_id", direction: 1 }],
  limit: 2,
};
const result = await call.queryMembers(queryMembersReq);

// loading the next page
const result = await call.queryMembers({
  ...queryMembersReq,
  next: result.next,
});

// filtering
const result = await call.queryMembers({
  filter_conditions: { role: { $eq: "admin" } },
});

Sort options

Sorting is supported on these fields:

  • user_id
  • created_at

Filter options

Name Type Description Supported operators
user_id string User ID $in, $eq, $gt, $gte, $lt, $lte, $exists
role string The role of the user $in, $eq, $gt, $gte, $lt, $lte, $exists
custom Object Search in custom membership data, example syntax: {'custom.color': {$eq: 'red'}} $in, $eq, $gt, $gte, $lt, $lte, $exists
created_at string, must be formatted as an RFC3339 timestamp (for example 2021-01-15T09:30:20.45Z) Creation time of the user $in, $eq, $gt, $gte, $lt, $lte, $exists
updated_at string, must be formatted as an RFC3339 timestamp (for example 2021-01-15T09:30:20.45Z) The time of the last update of the user $in, $eq, $gt, $gte, $lt, $lte, $exists

The Stream API allows you to specify filters and ordering for several endpoints. The query syntax is similar to that of Mongoose, however we do not run MongoDB on the backend. Only a subset of the MongoDB operations are supported. See filter operators guide for details.

Name Description Example
$eq Matches values that are equal to a specified value. { "key": { "$eq": "value" } } or the simplest form { "key": "value" }
$q Full text search (matches values where the whole text value matches the specified value) { "key": { "$q": "value" } }
$gt Matches values that are greater than a specified value. { "key": { "$gt": 4 } }
$gte Matches values that are greater than or equal to a specified value. { "key": { "$gte": 4 } }
$lt Matches values that are less than a specified value. { "key": { "$lt": 4 } }
$lte Matches values that are less than or equal to a specified value. { "key": { "$lte": 4 } }
$in Matches any of the values specified in an array. { "key": { "$in": [ 1, 2, 4 ] } }
$exists Matches values that either have (when set to true) or not have (when set to false) certain attributes { "key": { "$exists": true } }
$autocomplete Matches values that start with the specified string value { "key": { "$autocomplete": "value" } }

It's also possible to combine filter expressions with the following operators:

Name Description Example
$and Matches all the values specified in an array. { "$and": [ { "key": { "$in": [ 1, 2, 4 ] } }, { "some_other_key": 10 } ] }
$or Matches at least one of the values specified in an array. { "$or": [ { "key": { "$in": [ 1, 2, 4 ] } }, { "key2": 10 } ] }