Skip to content

Commit 43dbc5b

Browse files
Oxyjunthomasgauvin
andauthored
[Workers KV] API minor enhancements (#18266)
* Specifying that the REST APIs support bulk actions. * Specifying REST API where relevant. Renaming section to "Worker Binding API" * Update src/content/docs/kv/api/index.mdx Co-authored-by: Thomas Gauvin <[email protected]> --------- Co-authored-by: Thomas Gauvin <[email protected]>
1 parent 7b25121 commit 43dbc5b

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/content/docs/kv/api/delete-key-value-pairs.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To delete a key-value pair, call the `delete()` method of the [KV binding](/kv/c
1414
env.NAMESPACE.delete(key);
1515
```
1616

17-
#### Example
17+
#### Example
1818

1919
An example of deleting a key-value pair from within a Worker:
2020

@@ -68,9 +68,9 @@ Calling the `delete()` method will remove the key and value from your KV namespa
6868

6969
### Delete data in bulk
7070

71-
Delete more than one key-value pair at a time with Wrangler or [via the API](/api/operations/workers-kv-namespace-delete-multiple-key-value-pairs).
71+
Delete more than one key-value pair at a time with Wrangler or [via the REST API](/api/operations/workers-kv-namespace-delete-multiple-key-value-pairs).
7272

73-
The bulk API can accept up to 10,000 KV pairs at once. Bulk writes are not supported using the [KV binding](/kv/concepts/kv-bindings/).
73+
The bulk REST API can accept up to 10,000 KV pairs at once. Bulk writes are not supported using the [KV binding](/kv/concepts/kv-bindings/).
7474

7575
## Other methods to access KV
76-
You can also [delete key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#delete) or [with the API](/api/operations/workers-kv-namespace-delete-key-value-pair).
76+
You can also [delete key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#delete) or [with the REST API](/api/operations/workers-kv-namespace-delete-key-value-pair).

src/content/docs/kv/api/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
pcx_content_type: navigation
3-
title: API
3+
title: Workers Binding API
44
sidebar:
55
order: 3
66
group:

src/content/docs/kv/api/list-keys.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ To list all the keys in your KV namespace, call the `list()` method of the [KV b
1313
env.NAMESPACE.list();
1414
```
1515

16-
The `list()` method returns a promise you can `await` on to get the value.
16+
The `list()` method returns a promise you can `await` on to get the value.
1717

18-
#### Example
18+
#### Example
1919

2020
An example of listing keys from within a Worker:
2121

@@ -63,16 +63,16 @@ env.NAMESPACE.list(options?)
6363
#### Response
6464
* `response`: `Promise<{
6565
keys: {
66-
name: string,
66+
name: string,
6767
expiration?: number,
6868
metadata?: object
6969
}[],
7070
list_complete: boolean,
7171
cursor: string
7272
}>`
73-
* A `Promise` that resolves to an object containing `keys`, `list_complete`, and `cursor` attributes.
73+
* A `Promise` that resolves to an object containing `keys`, `list_complete`, and `cursor` attributes.
7474
* `keys` is an array that contains an object for each key listed. Each object has attributes `name`, `expiration` (optional), and `metadata` (optional). If the key-value pair has an expiration set, the expiration will be present and in absolute value form (even if it was set in TTL form). If the key-value pair has non-null metadata set, the metadata will be present.
75-
* `list_complete` is a boolean, which will be `false` if there are more keys to fetch, even if the `keys` array is empty.
75+
* `list_complete` is a boolean, which will be `false` if there are more keys to fetch, even if the `keys` array is empty.
7676
* `cursor` is a `string` used for paginating responses.
7777
7878
The `list()` method returns a promise which resolves with an object that looks like the following:
@@ -159,4 +159,4 @@ await NAMESPACE.put(key, "", {
159159
```
160160
161161
## Other methods to access KV
162-
You can also [list keys on the command line with Wrangler](/kv/reference/kv-commands/#list) or [with the API](/api/operations/workers-kv-namespace-list-a-namespace'-s-keys).
162+
You can also [list keys on the command line with Wrangler](/kv/reference/kv-commands/#list) or [with the REST API](/api/operations/workers-kv-namespace-list-a-namespace'-s-keys).

src/content/docs/kv/api/read-key-value-pairs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,5 @@ The effective `cacheTtl` of an already cached item can be reduced by getting it
162162
163163
## Other methods to access KV
164164
165-
You can [read key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#get) and [from the API](/api/operations/workers-kv-namespace-read-key-value-pair).
165+
You can [read key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#get) and [from the REST API](/api/operations/workers-kv-namespace-read-key-value-pair).
166166

src/content/docs/kv/api/write-key-value-pairs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Refer to [How KV works](/kv/concepts/how-kv-works/) for more information on this
8484
8585
### Write data in bulk
8686
87-
Write more than one key-value pair at a time with Wrangler or [via the API](/api/operations/workers-kv-namespace-write-multiple-key-value-pairs).
87+
Write more than one key-value pair at a time with Wrangler or [via the REST API](/api/operations/workers-kv-namespace-write-multiple-key-value-pairs).
8888
8989
The bulk API can accept up to 10,000 KV pairs at once.
9090
@@ -270,4 +270,4 @@ async function retryWithBackoff(
270270
271271
## Other methods to access KV
272272
273-
You can also [write key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#create) and [write data via the API](/api/operations/workers-kv-namespace-write-key-value-pair-with-metadata).
273+
You can also [write key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#create) and [write data via the REST API](/api/operations/workers-kv-namespace-write-key-value-pair-with-metadata).

0 commit comments

Comments
 (0)