@pi-r/redis 0.12.2 → 0.12.4

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/client/index.js CHANGED
@@ -218,7 +218,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
218
218
  }
219
219
  }
220
220
  cacheCredential = DbPool.sanitize(redisCredential || credential, sortKeys);
221
- if (ignoreCache !== 1) {
221
+ if (ignoreCache !== 1 && !item.update) {
222
222
  rows = this.getQueryResult(source, cacheCredential, queryString, cacheValue);
223
223
  if (rows) {
224
224
  if (parallel) {
@@ -304,6 +304,10 @@ async function executeBatchQuery(batch, options = '', outResult) {
304
304
  pending = client.json.arrIndex(k, path, v, s1 !== undefined ? { range: { start: s1, stop: convertFloat(stop) } } : undefined);
305
305
  break;
306
306
  }
307
+ case 'ARRLEN':
308
+ codeMin = -1;
309
+ pending = client.json.arrLen(k, { path });
310
+ break;
307
311
  case 'ARRPOP':
308
312
  codeMin = -Infinity;
309
313
  pending = client.json.arrPop(k, { path, index: convertFloat(index) });
@@ -349,6 +353,10 @@ async function executeBatchQuery(batch, options = '', outResult) {
349
353
  pending = client.json.strAppend(k, v, { path });
350
354
  }
351
355
  break;
356
+ case 'STRLEN':
357
+ codeMin = -1;
358
+ pending = client.json.strLen(k, { path });
359
+ break;
352
360
  default: {
353
361
  const flags = NX ? { NX } : XX ? { XX } : undefined;
354
362
  pending = client.json.set(k, path, v, flags);
@@ -432,7 +440,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
432
440
  }
433
441
  if (pending) {
434
442
  pending.then(async (code) => {
435
- if (code == null || code !== -Infinity && isString(code) && code !== 'OK' || typeof code === 'number' && code <= codeMin || Array.isArray(code) && code.every(resp => resp === null || typeof resp === 'number' && resp <= codeMin)) {
443
+ if (code == null || isString(code) && code !== 'OK' && codeMin !== -Infinity || typeof code === 'number' && code <= codeMin || Array.isArray(code) && code.every(resp => resp === null || typeof resp === 'number' && resp <= codeMin)) {
436
444
  failValue();
437
445
  return;
438
446
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/redis",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "description": "Redis client driver for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",
@@ -17,8 +17,8 @@
17
17
  "license": "MIT",
18
18
  "homepage": "https://github.com/anpham6/pi-r#readme",
19
19
  "dependencies": {
20
- "@e-mc/db": "^0.14.3",
21
- "@e-mc/types": "^0.14.3",
20
+ "@e-mc/db": "^0.14.5",
21
+ "@e-mc/types": "^0.14.5",
22
22
  "redis": "^5.12.1"
23
23
  }
24
24
  }
package/types/index.d.ts CHANGED
@@ -87,7 +87,7 @@ export interface JsonMSetItem {
87
87
  }
88
88
 
89
89
  export type RedisFormat = "HASH" | "JSON";
90
- export type RedisCommandJSON = "ARRAPPEND" | "ARRINDEX" | "ARRINSERT" | "ARRPOP" | "ARRTRIM" | "DEL" | "FORGET" | "MERGE" | "MSET" | "NUMINCRBY" | "NUMMULTBY" | "SET" | "STRAPPEND";
90
+ export type RedisCommandJSON = "ARRAPPEND" | "ARRINDEX" | "ARRINSERT" | "ARRLEN" | "ARRPOP" | "ARRTRIM" | "DEL" | "FORGET" | "MERGE" | "MSET" | "NUMINCRBY" | "NUMMULTBY" | "SET" | "STRAPPEND" | "STRLEN";
91
91
  export type RedisExpireCondition = "NX" | "XX" | "GT" | "LT";
92
92
  export type RedisCommandValue = RedisArgument | number;
93
93
  export type RedisClientPoolType<T extends RedisModules = RedisDefaultModules> = IRedisClientPoolType<T>;