Complete the code to open the Deno KV store.
const kv = await Deno.[1]();The method openKv() is used to open the Deno KV store asynchronously.
Complete the code to set a key-value pair in the KV store.
await kv.[1](['user', '123'], { name: 'Alice' });
The set method stores a value for a given key in the KV store.
Fix the error in the code to get a value from the KV store.
const result = await kv.[1](['user', '123']); console.log(result.value);
The get method retrieves the value for the given key from the KV store.
Fill both blanks to delete a key and check if deletion was successful.
const deleteResult = await kv.[1](['session', 'abc']); if (deleteResult.[2]) { console.log('Deleted successfully'); }
The delete method removes a key. The success property shows if it worked.
Fill all three blanks to create a transaction that sets and deletes keys atomically.
const txn = kv.[1](); txn.[2](['cart', 'item1'], { quantity: 2 }); txn.[3](['cart', 'item2']); await txn.commit();
Use atomic() to start a transaction, then set and delete to modify keys before committing.
