Caramastifer
Caramastifer
DDeno
Created by Caramastifer on 12/21/2023 in #help
Get only the first records with deno kv but reversed ordered
ok <:hooray_deno:1035517542200004688> after further reading the KV documentation I found what I was looking for https://docs.deno.com/kv/manual/operations
// Return all users in reverse order, ending with "sam"
const iter = kv.list<string>({ prefix: ["users"], start: ["users", "sam"] }, {
reverse: true,
});
const users = [];
for await (const res of iter) users.push(res);
console.log(users[0]); // { key: ["users", "taylor"], value: "taylor", versionstamp: "0059e9035e5e7c5e0000" }
console.log(users[1]); // { key: ["users", "sam"], value: "sam", versionstamp: "00e0a2a0f0178b270000" }
// Return all users in reverse order, ending with "sam"
const iter = kv.list<string>({ prefix: ["users"], start: ["users", "sam"] }, {
reverse: true,
});
const users = [];
for await (const res of iter) users.push(res);
console.log(users[0]); // { key: ["users", "taylor"], value: "taylor", versionstamp: "0059e9035e5e7c5e0000" }
console.log(users[1]); // { key: ["users", "sam"], value: "sam", versionstamp: "00e0a2a0f0178b270000" }
3 replies
DDeno
Created by Caramastifer on 12/2/2023 in #help
Optimize for Prod simple static vanilla JS script - WebServer App with Oak + DEJS
DEJS - ejs template engine for deno : https://deno.land/x/dejs@0.10.3
5 replies
DDeno
Created by Caramastifer on 12/2/2023 in #help
Optimize for Prod simple static vanilla JS script - WebServer App with Oak + DEJS
That seems to be it. Thank you for pointing this direction, was needing it!
5 replies