D
Deno

help

Does kv delete recursively?

MGMark G5/15/2023
For example, if I have entries with keys: ['users', 1], ['users', 2], will kv.delete(['users']) delete both of those entries? If the only way is to list and delete, it would be useful to allow the kv.delete op to accept the same selector as kv.list, to allow the underlying implementation to perform an efficient mass delete. Maybe the selector could be extended to take a 'keys' property too, then list could also be used as a consistent API with all the abilities of get/getMany/list, and delete would then also have this flexibility too.
Iiuioiua5/15/2023
kv.delete() only deletes a single entry.
ABAltair 680b5/15/2023
Single key delete is required for FDB - OCC and MVCC FoundationDB combines optimistic concurrency control (OCC) and multi-version concurrency control (MVCC). Each transaction requires a versionstamp that are assigned sequentially (per transaction). This wouldn't play nicely with bulk operations.
MGMark G5/16/2023
I'm not familiar with how FoundationDB works, but that's really an implementation detail. I don't think it should affect the ability to implement high level developer friendly APIs of Deno.KV. There is no reason the SQLite implementation couldn't perform a mass delete. If for FoundationDB the op translates to a list and individual deletes under the covers then so be it, future or alternative implementations may be able to improve on this without troubling the end users of Deno.KV with these details.
ABAltair 680b5/16/2023
I'm thinking that eventually there will be a higher level wrapper in the Deno.std lib, that may provide these features. In the mean time, a simple cursor loop of a few lines of code should work fine.

Looking for more? Join the community!

Recommended Posts
How do I send a simple text file to the printer?Hello. I am looking for an example of how to send a simple text file tot eh printer in Deno. Is thisActive Handles and RequestsI'm running into an issue with the `excel4node` NPM library, where after new'ing a Workbook, the proOak, `ctx.assert`, and middlewareI thought that `ctx.assert` would somehow "carry along" the information about the asserted conditionChecking for circular module dependencies?Hi, I’m wondering if there is some way to detect whether there are circular dependencies in a set ofList of all deno.land packages?Is there a list somewhere of all the deno.land packages on one page?Safety measures (statically, not runtime) for libraries that require environment variables?Suppose I have a Deno library which expects certain environment variables to have been configured, oTesting my Oak `Application` end-to-endI have an Oak application, and I'd like to test the main `const app = new Application()` configuratiAdding methods to Oak's Context?I am trying to figure out how to configure my Oak application/router so that my routes can do thingsClear cache modulesHello guys, I would like to know how can I remove unnecessary modules from cache? I've run - `denoHow does importing `node:https` work?Basically, how does it work? Does the machine need to have a Node.js environment installed for this?`await import()` without global executionHello there. This is some code from my `test.ts`:```ts // test.ts console.log("Hello World"); exportHTTPS custom cert passphrase in Deno?I have this code from a Node.js project, and I'm trying to figure out if there's any alternative in Increase http server timeout?How do i increase the timeout? Seems to be ~120 seconds by default, but we have longer running requeIs inspecting import.meta.url a reliable way to distinguish browser and deno contexts?I have been trying to figure out a good pattern to import JSON that will work whether called in deno