From 047e0bc0e6da0cdcffb11b374679ccd5aecac3a6 Mon Sep 17 00:00:00 2001 From: bahalool Date: Tue, 29 Jan 2019 10:06:42 +0200 Subject: [PATCH] list by prefix --- lib/adapter.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/adapter.js b/lib/adapter.js index 4933f7c..8b29fc7 100644 --- a/lib/adapter.js +++ b/lib/adapter.js @@ -36,6 +36,11 @@ class RedisAdapter { }); } + async listPrefixes(options) { + const res = await this.list(options); + return res.map(r => r.path.match(options.path + '/(.*)/')[1]); + } + async delete(options) { let { path } = options; if (!path.startsWith('/')) {