-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added docs for query call members (#545)
- Loading branch information
1 parent
578c416
commit 9ef4a25
Showing
4 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ationTests/DocumentationTests/DocumentationTests/03-guides/07-querying-call-members.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import StreamVideo | ||
import StreamVideoSwiftUI | ||
import SwiftUI | ||
import Combine | ||
|
||
@MainActor | ||
fileprivate func content() { | ||
asyncContainer { | ||
// sorting and pagination | ||
let sort = SortParamRequest(direction: 1, field: "user_id") | ||
let result1 = try await call.queryMembers( | ||
sort: [sort], | ||
limit: 10 | ||
) | ||
|
||
// loading the next page | ||
if let next = result1.next { | ||
let result2 = try await call.queryMembers(sort: [sort], limit: 10, next: next) | ||
} | ||
|
||
// filtering | ||
let result2 = try await call.queryMembers( | ||
filters: ["role": .dictionary(["eq": "admin"])] | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
id: querying-call-members | ||
title: Querying Call Members | ||
description: How to query call members | ||
--- | ||
|
||
import FilterConditions from '../../../shared/_filter-operators.mdx'; | ||
import CallMemberFilters from '../../../shared/video/_call-member-filters.mdx'; | ||
import CallMemberSort from '../../../shared/video/_call-member-sort-fields.mdx'; | ||
|
||
When you create or join a call you get a list of call members, however this can return at most 25 members: | ||
|
||
```swift | ||
// The maximum limit is 25 | ||
// The default limit is 25 | ||
try await call.get(membersLimit: 25) | ||
``` | ||
|
||
To get the complete list of call members the Stream API allows you to query, filter and sort members of a call using a paginated list. | ||
|
||
## Examples | ||
|
||
Below are a few examples of how to use this API: | ||
|
||
```swift | ||
// sorting and pagination | ||
let sort = SortParamRequest(direction: 1, field: "user_id") | ||
let result1 = try await call.queryMembers( | ||
sort: [sort], | ||
limit: 10 | ||
) | ||
|
||
// loading the next page | ||
if let next = result1.next { | ||
let result2 = try await call.queryMembers(sort: [sort], limit: 10, next: next) | ||
} | ||
|
||
// filtering | ||
let result2 = try await call.queryMembers( | ||
filters: ["role": .dictionary(["eq": "admin"])] | ||
) | ||
``` | ||
|
||
## Sort options | ||
|
||
<CallMemberSort /> | ||
|
||
## Filter options | ||
|
||
<CallMemberFilters /> | ||
|
||
<FilterConditions /> |