Skip to content

Commit eff5523

Browse files
committed
checking perms
1 parent 69b5d20 commit eff5523

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
async fetch(request, env, ctx) {
2727
try {
2828
const value = await env.NAMESPACE.get("first-key");
29+
test;
2930

3031
if (value === null) {
3132
return new Response("Value not found", { status: 404 });
@@ -46,7 +47,9 @@ export default {
4647
try {
4748
const value = await env.NAMESPACE.get(["first-key", "second-key"]);
4849

49-
return new Response("values: " + value.get("second-key") + " " + value.get("second-key"));
50+
return new Response(
51+
"values: " + value.get("second-key") + " " + value.get("second-key"),
52+
);
5053
} catch (e) {
5154
return new Response(e.message, { status: 500 });
5255
}
@@ -65,8 +68,8 @@ The following methods are provided to read from KV:
6568

6669
Use the `get()` method to get a single value, or multiple values if given multiple keys:
6770

68-
* Read single keys with [get(key)](#request-a-single-key)
69-
* Read multiple keys with [get([keys])](#request-multiple-keys)
71+
- Read single keys with [get(key)](#request-a-single-key)
72+
- Read multiple keys with [get([keys])](#request-multiple-keys)
7073

7174
#### Request a single key
7275

@@ -261,7 +264,9 @@ export default {
261264
try {
262265
const response = await env.NAMESPACE.getWithMetadata(["first-key"]);
263266
const firstValue = response.get("first-key");
264-
return new Response("value: " + firstValue?.value + " metadata: " + firstValue?.metadata);
267+
return new Response(
268+
"value: " + firstValue?.value + " metadata: " + firstValue?.metadata,
269+
);
265270
} catch (e) {
266271
return new Response(e.message, { status: 500 });
267272
}
@@ -297,4 +302,3 @@ The effective `cacheTtl` of an already cached item can be reduced by getting it
297302
## Other methods to access KV
298303
299304
You can [read key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#kv-key-get) and [from the REST API](/api/resources/kv/subresources/namespaces/subresources/values/methods/get/).
300-

0 commit comments

Comments
 (0)