Skip to content

Commit

Permalink
Merge pull request #118 from GetStream/docs-update
Browse files Browse the repository at this point in the history
Add shared table for filter operators, query call and member filter o…
  • Loading branch information
szuperaz committed Nov 9, 2023
2 parents e47c555 + 8ac0e19 commit e6aeee5
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ yarn-error.log
/.log/
.docusaurus
*_version*
.vscode/
20 changes: 20 additions & 0 deletions shared/_filter-operators.mdx
@@ -0,0 +1,20 @@
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.

| 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` | Mathces values that either have (when set to `true`) or not have (when set to `false`) certain attributes | `{ "key": { "$exists": true } }` |
| `$autocomplete` | Mathces 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 } ] }` |
14 changes: 14 additions & 0 deletions shared/video/_call-filters.mdx
@@ -0,0 +1,14 @@
| Name | Type | Description | Supported operators |
| -------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------- |
| `id` | string | Call ID | `$in`, `$eq`, `$gt, $gte`, `$lt`, `$lte`, `$exists` |
| `cid` | string | Call CID (format: type:id) | `$in`, `$eq`, `$gt, $gte`, `$lt`, `$lte`, `$exists` |
| `team` | string | The team associated with the channel | `$in`, `$eq`, `$gt, $gte`, `$lt`, `$lte`, `$exists` |
| `type` | string | Call type | `$in`, `$eq`, `$gt, $gte`, `$lt`, `$lte`, `$exists` |
| `created_by_user_id` | string | User ID of the call's creator | `$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 call | `$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 call | `$in`, `$eq`, `$gt, $gte`, `$lt`, `$lte`, `$exists` |
| `ended_at` | string, must be formatted as an RFC3339 timestamp (for example 2021-01-15T09:30:20.45Z) | The time the call was ended | `$in`, `$eq`, `$gt, $gte`, `$lt`, `$lte`, `$exists` |
| `starts_at` | string, must be formatted as an RFC3339 timestamp (for example 2021-01-15T09:30:20.45Z) | The scheduled start time of the call | `$in`, `$eq`, `$gt, $gte`, `$lt`, `$lte`, `$exists` |
| `backstage` | boolean | `true` if the call is in backstage mode | `$eq` |
| `members` | string array | Member user ids | `$in` |
| `ongoing` | boolean | `true` if there is an ongoing session for the call | `$eq` |
7 changes: 7 additions & 0 deletions shared/video/_call-member-filters.mdx
@@ -0,0 +1,7 @@
| 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 user data | `$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` |
4 changes: 4 additions & 0 deletions shared/video/_call-member-sort-fields.mdx
@@ -0,0 +1,4 @@
Sorting is supported on these fields:

- `user_id`
- `created_at`
9 changes: 9 additions & 0 deletions shared/video/_call-sort-fields.mdx
@@ -0,0 +1,9 @@
Sorting is supported on these fields:

- `starts_at`
- `created_at`
- `updated_at`
- `ended_at`
- `type`
- `id`
- `cid`

0 comments on commit e6aeee5

Please sign in to comment.