Skip to content

Commit

Permalink
fix(upstash): drop base prefix from keyKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 11, 2024
1 parent d73140c commit 8711a94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/drivers/upstash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ export default defineDriver<UpstashOptions, Redis>(
.del(r(key))
.then(() => {});
},
getKeys(base) {
return getClient().keys(r(base, "*"));
getKeys(_base) {
return getClient()
.keys(r(_base, "*"))
.then((keys) =>
base ? keys.map((key) => key.slice(base.length + 1)) : keys
);
},
async clear(base) {
const keys = await getClient().keys(r(base, "*"));
Expand Down

0 comments on commit 8711a94

Please sign in to comment.