You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,8 +23,7 @@ its results are atomic and isolated from all other storage operations, even when
22
23
accessing multiple key-value pairs.
23
24
24
25
<sup>2</sup> KV API methods like `get()`, `put()`, `delete()`, or `list()` store
25
-
data in a hidden SQLite table.
26
-
27
-
<sup>3</sup> For SQLite-backed Durable Objects, you can use [synchronous KV API methods](/durable-objects/api/sqlite-storage-api/#synchronous-kv-api) using `ctx.storage.kv`. KV-backed Durable Objects use [asynchronous KV API methods](/durable-objects/api/legacy-kv-storage-api/#asynchronous-kv-api).
26
+
data in a hidden SQLite table `__cf_kv`. Note that you will be able view this table when listing all tables, you will not be able to query it.
28
27
28
+
<sup>3</sup> SQLite-backed Durable Objects also use [synchronous KV API methods](/durable-objects/api/sqlite-storage-api/#synchronous-kv-api) using `ctx.storage.kv`, whereas KV-backed Durable Objects only provide [asynchronous KV API methods](/durable-objects/api/legacy-kv-storage-api/#asynchronous-kv-api).
- Retrieves the value associated with the given key. The type of the returned value will be whatever was previously written for the key, or undefined if the key does not exist.
- Retrieves the values associated with each of the provided keys. The type of each returned value in the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) will be whatever was previously written for the corresponding key. Results in the `Map` will be sorted in increasing order of their UTF-8 encodings, with any requested keys that do not exist being omitted. Supports up to 128 keys at a time.
14
-
15
-
#### Supported options
16
-
17
-
-`allowConcurrency`: <Typetext='boolean' />
18
-
- By default, the system will pause delivery of I/O events to the Object while a storage operation is in progress, in order to avoid unexpected race conditions. Pass `allowConcurrency: true` to opt out of this behavior and allow concurrent events to be delivered.
19
-
20
-
-`noCache`: <Typetext='boolean'/>
21
-
- If true, then the key/value will not be inserted into the in-memory cache. If the key is already in the cache, the cached value will be returned, but its last-used time will not be updated. Use this when you expect this key will not be used again in the near future. This flag is only a hint. This flag will never change the semantics of your code, but it may affect performance.
22
-
23
12
### `put`
24
13
25
-
- <code>put(key <Typetext="string" />, value <Typetext="any" />)</code>: <Typetext="void" />
14
+
- <code>ctx.storage.kv.put(key <Typetext="string" />, value <Typetext="any" />)</code>: <Typetext="void" />
26
15
- Stores the value and associates it with the given key. The value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types.
27
16
28
17
The size of keys and values have different limits depending on the Durable Object storage backend you are using. Refer to either:
- Takes an Object and stores each of its keys and values to storage.
34
-
- Each value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types.
35
-
- Supports up to 128 key-value pairs at a time. The size of keys and values have different limits depending on the flavor of Durable Object you are using. Refer to either:
- Returns all keys and values associated with the current Durable Object in ascending sorted order based on the keys' UTF-8 encodings.
50
29
- The type of each returned value in the [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) will be whatever was previously written for the corresponding key.
0 commit comments