Skip to content

Commit

Permalink
Clarify how filtering works with multiple key-value pairs (#545)
Browse files Browse the repository at this point in the history
Update docs to make it clear how sandbox filtering works with multiple
key-value metadata pairs.
  • Loading branch information
mlejva authored Jan 18, 2025
2 parents 2f22248 + 8703049 commit 69025a7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/web/src/app/(docs)/docs/sandbox/list/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ Running sandbox template id: 3e4rngfa34txe0gxc1zf

## Filtering sandboxes
<Note>
This feature is in private beta.
This feature is in a private beta.
</Note>

You can filter sandboxes by:
- <Link href="/docs/sandbox/metadata">Metadata</Link> key value pairs
You can filter sandboxes by specifying <Link href="/docs/sandbox/metadata">Metadata</Link> key value pairs.
Specifying multiple key value pairs will return sandboxes that match all of them.

This can be useful when you have a large number of sandboxes and want to find only specific ones. The filtering is performed on the server side.
This can be useful when you have a large number of sandboxes and want to find only specific ones. The filtering is performed on the server.

<CodeGroup>
```js
Expand All @@ -85,7 +85,7 @@ const sandbox = await Sandbox.create({
},
})

// List running sandboxes filtered by metadata.
// List running sandboxes that has `userId` key with value `123` and `env` key with value `dev`.
const runningSandboxes = await Sandbox.list({
filters: { userId: '123', env: 'dev' } // $HighlightLine
})
Expand All @@ -102,7 +102,7 @@ sandbox = Sandbox(
},
)

# List running sandboxes filtered by metadata.
# List running sandboxes that has `userId` key with value `123` and `env` key with value `dev`.
running_sandboxes = Sandbox.list(filters={
"userId": "123", "env": "dev" # $HighlightLine
})
Expand Down

0 comments on commit 69025a7

Please sign in to comment.