Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/content/docs/kv/api/delete-key-value-pairs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To delete a key-value pair, call the `delete()` method of the [KV binding](/kv/c
env.NAMESPACE.delete(key);
```

#### Example
#### Example

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

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

### Delete data in bulk

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).
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).

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/).
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/).

## Other methods to access KV
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).
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).
2 changes: 1 addition & 1 deletion src/content/docs/kv/api/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
pcx_content_type: navigation
title: API
title: Worker Binding API
sidebar:
order: 3
group:
Expand Down
12 changes: 6 additions & 6 deletions src/content/docs/kv/api/list-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ To list all the keys in your KV namespace, call the `list()` method of the [KV b
env.NAMESPACE.list();
```

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

#### Example
#### Example

An example of listing keys from within a Worker:

Expand Down Expand Up @@ -63,16 +63,16 @@ env.NAMESPACE.list(options?)
#### Response
* `response`: `Promise<{
keys: {
name: string,
name: string,
expiration?: number,
metadata?: object
}[],
list_complete: boolean,
cursor: string
}>`
* A `Promise` that resolves to an object containing `keys`, `list_complete`, and `cursor` attributes.
* A `Promise` that resolves to an object containing `keys`, `list_complete`, and `cursor` attributes.
* `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.
* `list_complete` is a boolean, which will be `false` if there are more keys to fetch, even if the `keys` array is empty.
* `list_complete` is a boolean, which will be `false` if there are more keys to fetch, even if the `keys` array is empty.
* `cursor` is a `string` used for paginating responses.

The `list()` method returns a promise which resolves with an object that looks like the following:
Expand Down Expand Up @@ -159,4 +159,4 @@ await NAMESPACE.put(key, "", {
```

## Other methods to access KV
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).
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).
2 changes: 1 addition & 1 deletion src/content/docs/kv/api/read-key-value-pairs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ The effective `cacheTtl` of an already cached item can be reduced by getting it

## Other methods to access KV

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).
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).

4 changes: 2 additions & 2 deletions src/content/docs/kv/api/write-key-value-pairs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Refer to [How KV works](/kv/concepts/how-kv-works/) for more information on this

### Write data in bulk

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).
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).

The bulk API can accept up to 10,000 KV pairs at once.

Expand Down Expand Up @@ -270,4 +270,4 @@ async function retryWithBackoff(

## Other methods to access KV

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).
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).
Loading