-
Notifications
You must be signed in to change notification settings - Fork 10k
KV: add bulk gets documentation #21392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
thomasgauvin
merged 14 commits into
cloudflare:production
from
teresalves:teresalves/add-workers-kv-get-bulk
Apr 17, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d5a732c
KV: add bulk gets documentation
teresalves 25cfc00
PCX review
Oxyjun 9b31c27
Update src/content/docs/kv/api/read-key-value-pairs.mdx
thomasgauvin 2448cd3
Update src/content/docs/kv/api/read-key-value-pairs.mdx
thomasgauvin 4ea50e7
Update src/content/docs/kv/api/read-key-value-pairs.mdx
thomasgauvin 20a5d74
Update src/content/docs/kv/api/read-key-value-pairs.mdx
thomasgauvin 69b5d20
Update src/content/docs/kv/api/read-key-value-pairs.mdx
thomasgauvin eff5523
checking perms
thomasgauvin a70d1d7
wip
thomasgauvin 72f0b94
fix: delete changes to settings.json file
teresalves baff3c0
adjust changelog
thomasgauvin af2c1c9
Update .vscode/settings.json
thomasgauvin 21e858c
fix styling, missing differentiation between h4 and h5
thomasgauvin dbcca5b
Update src/content/changelog/kv/2025-04-10-kv-bulk-reads.mdx
thomasgauvin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,25 @@ | ||
| --- | ||
| title: Read multiple keys from Workers KV with bulk reads | ||
| description: You can now retrieve up to 100 keys in a single bulk read request to Workers KV. | ||
| products: | ||
| - kv | ||
| date: 2025-04-17T14:00:00Z | ||
| --- | ||
|
|
||
| You can now retrieve up to 100 keys in a single bulk read request made to Workers KV using the binding. | ||
|
|
||
| This makes it easier to request multiple KV pairs within a single Worker invocation. Retrieving many key-value pairs using the bulk read operation is more performant than making individual requests since bulk read operations are not affected by [Workers simultaneous connection limits](/workers/platform/limits/#simultaneous-open-connections). | ||
| ```js | ||
| // Read single key | ||
| const key = "key-a"; | ||
| const value = await env.NAMESPACE.get(keys); | ||
|
|
||
| // Read multiple keys | ||
| const keys = ["key-a", "key-b", "key-c", ...] // up to 100 keys | ||
| const values : Map<string, string?> = await env.NAMESPACE.get(keys); | ||
|
|
||
| // Print the value of "key-a" to the console. | ||
| console.log(`The first key is ${values.get("key-a")}.`) | ||
| ``` | ||
|
|
||
| Consult the [Workers KV Read key-value pairs API](/kv/api/read-key-value-pairs/) for full details on Workers KV's new bulk reads support. | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| :root { | ||
| --sl-text-h4: var(--sl-text-base); | ||
| --sl-text-h4: var(--sl-text-lg); | ||
| --sl-text-h5: var(--sl-text-base); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.