@jusbid/redis 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +12 -1
- package/package.json +4 -1
package/index.js
CHANGED
|
@@ -866,6 +866,16 @@ const xReadGroupNew = async (...args) => {
|
|
|
866
866
|
}
|
|
867
867
|
};
|
|
868
868
|
|
|
869
|
+
|
|
870
|
+
const deleteByPattern = async (pattern) => {
|
|
871
|
+
const keys = await redisClient.keys(pattern)
|
|
872
|
+
if (keys.length > 0) {
|
|
873
|
+
await redisClient.del(keys);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
return keys.length;
|
|
877
|
+
}
|
|
878
|
+
|
|
869
879
|
module.exports = {
|
|
870
880
|
redisClient,
|
|
871
881
|
get,
|
|
@@ -889,5 +899,6 @@ module.exports = {
|
|
|
889
899
|
xAutoClaim,
|
|
890
900
|
xDel,
|
|
891
901
|
xTrim,
|
|
892
|
-
xReadGroupNew
|
|
902
|
+
xReadGroupNew,
|
|
903
|
+
deleteByPattern
|
|
893
904
|
};
|
package/package.json
CHANGED