redis export keys

This commit is contained in:
Jan Prochazka
2022-03-27 12:57:44 +02:00
parent c0fdcf2fd1
commit 1f0ae98c88
5 changed files with 43 additions and 0 deletions

View File

@@ -163,6 +163,20 @@ const driver = {
return res;
},
async exportKeys(pool, options) {
const dump = new RedisDump({ client: pool });
return new Promise((resolve, reject) => {
dump.export({
type: 'redis',
keyPrefix: options.keyPrefix,
callback: (err, data) => {
if (err) reject(err);
else resolve(data);
},
});
});
},
async getKeys(pool, keyQuery = '*') {
const res = [];
let cursor = 0;