You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
WIP
This commit is contained in:
@@ -168,6 +168,7 @@ Some command arguments/replies have changed to align more closely to data types
|
|||||||
- `CLUSTER FAILOVER`: `enum FailoverModes` -> `const FAILOVER_MODES` [^enum-to-constants], the second argument is `{ mode: string; }` instead of `string` [^future-proofing]
|
- `CLUSTER FAILOVER`: `enum FailoverModes` -> `const FAILOVER_MODES` [^enum-to-constants], the second argument is `{ mode: string; }` instead of `string` [^future-proofing]
|
||||||
- `CLUSTER LINKS`: `createTime` -> `create-time`, `sendBufferAllocated` -> `send-buffer-allocated`, `sendBufferUsed` -> `send-buffer-used` [^map-keys]
|
- `CLUSTER LINKS`: `createTime` -> `create-time`, `sendBufferAllocated` -> `send-buffer-allocated`, `sendBufferUsed` -> `send-buffer-used` [^map-keys]
|
||||||
- `TIME`: `Date` -> `[unixTimestamp: string, microseconds: string]`
|
- `TIME`: `Date` -> `[unixTimestamp: string, microseconds: string]`
|
||||||
|
- `ZMPOP`: `{ elements: Array<{ member: string; score: number; }>; }` -> `{ members: Array<{ value: string; score: number; }>; }` to match other sorted set commands (e.g. `ZRANGE`, `ZSCAN`)
|
||||||
|
|
||||||
[^enum-to-constants]: TODO
|
[^enum-to-constants]: TODO
|
||||||
|
|
||||||
|
@@ -308,11 +308,7 @@ export type Resp2Reply<RESP3REPLY> = (
|
|||||||
RESP_TYPES['ARRAY'],
|
RESP_TYPES['ARRAY'],
|
||||||
Resp2Array<Extract<TYPES, Array<any>>>
|
Resp2Array<Extract<TYPES, Array<any>>>
|
||||||
> :
|
> :
|
||||||
RespType<
|
RESP3REPLY :
|
||||||
RESP_TYPE,
|
|
||||||
DEFAULT,
|
|
||||||
TYPES
|
|
||||||
> :
|
|
||||||
RESP3REPLY
|
RESP3REPLY
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { Command } from '../RESP/types';
|
import { Command } from '../RESP/types';
|
||||||
import { transformLMPopArguments, LMPopOptions, ListSide, RedisVariadicArgument } from './generic-transformers';
|
import { ListSide, RedisVariadicArgument } from './generic-transformers';
|
||||||
import LMPOP from './LMPOP';
|
import LMPOP, { LMPopOptions, transformLMPopArguments } from './LMPOP';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
FIRST_KEY_INDEX: 3,
|
FIRST_KEY_INDEX: 3,
|
||||||
|
@@ -1,5 +1,26 @@
|
|||||||
import { NullReply, TuplesReply, BlobStringReply, Command } from '../RESP/types';
|
import { CommandArguments, NullReply, TuplesReply, BlobStringReply, Command } from '../RESP/types';
|
||||||
import { transformLMPopArguments, LMPopOptions, ListSide, RedisVariadicArgument } from './generic-transformers';
|
import { ListSide, RedisVariadicArgument, pushVariadicArgument } from './generic-transformers';
|
||||||
|
|
||||||
|
export interface LMPopOptions {
|
||||||
|
COUNT?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function transformLMPopArguments(
|
||||||
|
args: CommandArguments,
|
||||||
|
keys: RedisVariadicArgument,
|
||||||
|
side: ListSide,
|
||||||
|
options?: LMPopOptions
|
||||||
|
): CommandArguments {
|
||||||
|
pushVariadicArgument(args, keys);
|
||||||
|
|
||||||
|
args.push(side);
|
||||||
|
|
||||||
|
if (options?.COUNT) {
|
||||||
|
args.push('COUNT', options.COUNT.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
FIRST_KEY_INDEX: 2,
|
FIRST_KEY_INDEX: 2,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { RedisArgument, NumberReply, DoubleReply, Command, CommandArguments } from '../RESP/types';
|
import { RedisArgument, Command } from '../RESP/types';
|
||||||
import { ZMember, transformDoubleArgument, transformDoubleReply } from './generic-transformers';
|
import { SortedSetMember, transformDoubleArgument, transformDoubleReply } from './generic-transformers';
|
||||||
|
|
||||||
export interface ZAddOptions {
|
export interface ZAddOptions {
|
||||||
condition?: 'NX' | 'XX';
|
condition?: 'NX' | 'XX';
|
||||||
@@ -27,7 +27,7 @@ export default {
|
|||||||
FIRST_KEY_INDEX: 1,
|
FIRST_KEY_INDEX: 1,
|
||||||
transformArguments(
|
transformArguments(
|
||||||
key: RedisArgument,
|
key: RedisArgument,
|
||||||
members: ZMember | Array<ZMember>,
|
members: SortedSetMember | Array<SortedSetMember>,
|
||||||
options?: ZAddOptions
|
options?: ZAddOptions
|
||||||
) {
|
) {
|
||||||
const args = ['ZADD', key];
|
const args = ['ZADD', key];
|
||||||
@@ -56,16 +56,12 @@ export default {
|
|||||||
|
|
||||||
return args;
|
return args;
|
||||||
},
|
},
|
||||||
transformReply: {
|
transformReply: transformDoubleReply
|
||||||
2: transformDoubleReply,
|
|
||||||
3: undefined as unknown as () => NumberReply
|
|
||||||
}
|
|
||||||
} as const satisfies Command;
|
} as const satisfies Command;
|
||||||
|
|
||||||
export function pushMembers(
|
export function pushMembers(
|
||||||
args: CommandArguments,
|
args: Array<RedisArgument>,
|
||||||
members: ZMember | Array<ZMember>
|
members: SortedSetMember | Array<SortedSetMember>) {
|
||||||
) {
|
|
||||||
if (Array.isArray(members)) {
|
if (Array.isArray(members)) {
|
||||||
for (const member of members) {
|
for (const member of members) {
|
||||||
pushMember(args, member);
|
pushMember(args, member);
|
||||||
@@ -75,7 +71,10 @@ export function pushMembers(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function pushMember(args: Array<RedisArgument>, member: ZMember) {
|
function pushMember(
|
||||||
|
args: Array<RedisArgument>,
|
||||||
|
member: SortedSetMember
|
||||||
|
) {
|
||||||
args.push(
|
args.push(
|
||||||
transformDoubleArgument(member.score),
|
transformDoubleArgument(member.score),
|
||||||
member.value
|
member.value
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { RedisArgument, DoubleReply, NullReply, Command } from '../RESP/types';
|
import { RedisArgument, Command } from '../RESP/types';
|
||||||
import { pushMembers } from './ZADD';
|
import { pushMembers } from './ZADD';
|
||||||
import { ZMember, transformDoubleArgument, transformNullableDoubleReply } from './generic-transformers';
|
import { SortedSetMember, transformNullableDoubleReply } from './generic-transformers';
|
||||||
|
|
||||||
export interface ZAddOptions {
|
export interface ZAddOptions {
|
||||||
condition?: 'NX' | 'XX';
|
condition?: 'NX' | 'XX';
|
||||||
@@ -12,7 +12,7 @@ export default {
|
|||||||
FIRST_KEY_INDEX: 1,
|
FIRST_KEY_INDEX: 1,
|
||||||
transformArguments(
|
transformArguments(
|
||||||
key: RedisArgument,
|
key: RedisArgument,
|
||||||
members: ZMember | Array<ZMember>,
|
members: SortedSetMember | Array<SortedSetMember>,
|
||||||
options?: ZAddOptions
|
options?: ZAddOptions
|
||||||
) {
|
) {
|
||||||
const args = ['ZADD', key];
|
const args = ['ZADD', key];
|
||||||
@@ -35,8 +35,5 @@ export default {
|
|||||||
|
|
||||||
return args;
|
return args;
|
||||||
},
|
},
|
||||||
transformReply: {
|
transformReply: transformNullableDoubleReply
|
||||||
2: transformNullableDoubleReply,
|
|
||||||
3: undefined as unknown as () => DoubleReply | NullReply
|
|
||||||
}
|
|
||||||
} as const satisfies Command;
|
} as const satisfies Command;
|
||||||
|
@@ -15,8 +15,5 @@ export default {
|
|||||||
member
|
member
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
transformReply: {
|
transformReply: transformDoubleReply
|
||||||
2: transformDoubleReply,
|
|
||||||
3: undefined as unknown as () => DoubleReply
|
|
||||||
}
|
|
||||||
} as const satisfies Command;
|
} as const satisfies Command;
|
||||||
|
@@ -5,6 +5,7 @@ import { ZKeys } from './generic-transformers';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
FIRST_KEY_INDEX: 1,
|
FIRST_KEY_INDEX: 1,
|
||||||
|
IS_READ_ONLY: false,
|
||||||
transformArguments(
|
transformArguments(
|
||||||
destination: RedisArgument,
|
destination: RedisArgument,
|
||||||
keys: ZKeys,
|
keys: ZKeys,
|
||||||
|
@@ -1,32 +1,55 @@
|
|||||||
// import { strict as assert } from 'assert';
|
import { strict as assert } from 'assert';
|
||||||
// import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
// import { transformArguments } from './ZMPOP';
|
import ZMPOP from './ZMPOP';
|
||||||
|
|
||||||
// describe('ZMPOP', () => {
|
describe('ZMPOP', () => {
|
||||||
// testUtils.isVersionGreaterThanHook([7]);
|
testUtils.isVersionGreaterThanHook([7]);
|
||||||
|
|
||||||
// describe('transformArguments', () => {
|
describe('transformArguments', () => {
|
||||||
// it('simple', () => {
|
it('simple', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('key', 'MIN'),
|
ZMPOP.transformArguments('key', 'MIN'),
|
||||||
// ['ZMPOP', '1', 'key', 'MIN']
|
['ZMPOP', '1', 'key', 'MIN']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with score and count', () => {
|
it('with count', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('key', 'MIN', {
|
ZMPOP.transformArguments('key', 'MIN', {
|
||||||
// COUNT: 2
|
COUNT: 2
|
||||||
// }),
|
}),
|
||||||
// ['ZMPOP', '1', 'key', 'MIN', 'COUNT', '2']
|
['ZMPOP', '1', 'key', 'MIN', 'COUNT', '2']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
// });
|
});
|
||||||
|
|
||||||
// testUtils.testWithClient('client.zmPop', async client => {
|
testUtils.testAll('zmPop - null', async client => {
|
||||||
// assert.deepEqual(
|
assert.equal(
|
||||||
// await client.zmPop('key', 'MIN'),
|
await client.zmPop('key', 'MIN'),
|
||||||
// null
|
null
|
||||||
// );
|
);
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
}, {
|
||||||
// });
|
client: GLOBAL.SERVERS.OPEN,
|
||||||
|
cluster: GLOBAL.CLUSTERS.OPEN
|
||||||
|
});
|
||||||
|
|
||||||
|
testUtils.testAll('zmPop - with members', async client => {
|
||||||
|
const members = [{
|
||||||
|
value: '1',
|
||||||
|
score: 1
|
||||||
|
}];
|
||||||
|
|
||||||
|
const [, reply] = await Promise.all([
|
||||||
|
client.zAdd('key', members),
|
||||||
|
client.zmPop('key', 'MIN')
|
||||||
|
]);
|
||||||
|
|
||||||
|
assert.deepEqual(reply, {
|
||||||
|
key: 'key',
|
||||||
|
members
|
||||||
|
});
|
||||||
|
}, {
|
||||||
|
client: GLOBAL.SERVERS.OPEN,
|
||||||
|
cluster: GLOBAL.CLUSTERS.OPEN
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@@ -1,61 +1,51 @@
|
|||||||
// import { NullReply, TuplesReply, BlobStringReply, DoubleReply, ArrayReply, Resp2Reply, Command, RedisArgument } from '../RESP/types';
|
import { NullReply, TuplesReply, BlobStringReply, DoubleReply, ArrayReply, Resp2Reply, Command } from '../RESP/types';
|
||||||
// import { pushVariadicArgument, RedisVariadicArgument, SortedSetSide } from './generic-transformers';
|
import { pushVariadicArgument, RedisVariadicArgument, SortedSetSide, transformSortedSetReply } from './generic-transformers';
|
||||||
|
|
||||||
// export interface ZMPopOptions {
|
export interface ZMPopOptions {
|
||||||
// COUNT?: number;
|
COUNT?: number;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// export type ZMPopRawReply = NullReply | TuplesReply<[
|
export type ZMPopRawReply = NullReply | TuplesReply<[
|
||||||
// key: BlobStringReply,
|
key: BlobStringReply,
|
||||||
// elements: ArrayReply<TuplesReply<[
|
members: ArrayReply<TuplesReply<[
|
||||||
// member: BlobStringReply,
|
value: BlobStringReply,
|
||||||
// score: DoubleReply
|
score: DoubleReply
|
||||||
// ]>>
|
]>>
|
||||||
// ]>;
|
]>;
|
||||||
|
|
||||||
// export function pushZMPopArguments(
|
export default {
|
||||||
// args: Array<RedisArgument>,
|
FIRST_KEY_INDEX: 2,
|
||||||
// keys: RedisVariadicArgument,
|
IS_READ_ONLY: false,
|
||||||
// side: SortedSetSide,
|
transformArguments(
|
||||||
// options: ZMPopOptions
|
keys: RedisVariadicArgument,
|
||||||
// )
|
side: SortedSetSide,
|
||||||
|
options?: ZMPopOptions
|
||||||
|
) {
|
||||||
|
const args = pushVariadicArgument(['ZMPOP'], keys);
|
||||||
|
|
||||||
// export default {
|
args.push(side);
|
||||||
// FIRST_KEY_INDEX: 2,
|
|
||||||
// IS_READ_ONLY: false,
|
|
||||||
// transformArguments(
|
|
||||||
// keys: RedisVariadicArgument,
|
|
||||||
// side: SortedSetSide,
|
|
||||||
// options?: ZMPopOptions
|
|
||||||
// ) {
|
|
||||||
// const args = pushVariadicArgument(['ZMPOP'], keys);
|
|
||||||
|
|
||||||
// args.push(side);
|
if (options?.COUNT) {
|
||||||
|
args.push('COUNT', options.COUNT.toString());
|
||||||
|
}
|
||||||
|
|
||||||
// if (options?.COUNT) {
|
return args;
|
||||||
// args.push('COUNT', options.COUNT.toString());
|
},
|
||||||
// }
|
transformReply: {
|
||||||
|
2: (reply: Resp2Reply<ZMPopRawReply>) => {
|
||||||
// return args;
|
return reply === null ? null : {
|
||||||
// },
|
key: reply[0],
|
||||||
// transformReply: {
|
members: reply[1].map(([value, score]) => ({
|
||||||
// 2: (reply: Resp2Reply<ZMPopRawReply>) => {
|
value,
|
||||||
// return reply === null ? null : {
|
score: Number(score)
|
||||||
// key: reply[0],
|
}))
|
||||||
// elements: reply[1].map(([member, score]) => ({
|
};
|
||||||
// member,
|
},
|
||||||
// score: Number(score)
|
3: (reply: ZMPopRawReply) => {
|
||||||
// }))
|
return reply === null ? null : {
|
||||||
// };
|
key: reply[0],
|
||||||
// },
|
members: transformSortedSetReply[3](reply[1])
|
||||||
// 3: (reply: ZMPopRawReply) => {
|
};
|
||||||
// return reply === null ? null : {
|
},
|
||||||
// key: reply[0],
|
}
|
||||||
// elements: reply[1].map(([member, score]) => ({
|
} as const satisfies Command;
|
||||||
// member,
|
|
||||||
// score
|
|
||||||
// }))
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// }
|
|
||||||
// } as const satisfies Command;
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { RedisArgument, ArrayReply, NullReply, BlobStringReply, DoubleReply, Command } from '../RESP/types';
|
import { RedisArgument, ArrayReply, NullReply, BlobStringReply, DoubleReply, Command } from '../RESP/types';
|
||||||
import { pushVariadicArguments, RedisVariadicArgument } from './generic-transformers';
|
import { pushVariadicArguments, RedisVariadicArgument, transformNullableDoubleReply } from './generic-transformers';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
FIRST_KEY_INDEX: 1,
|
FIRST_KEY_INDEX: 1,
|
||||||
@@ -12,7 +12,7 @@ export default {
|
|||||||
},
|
},
|
||||||
transformReply: {
|
transformReply: {
|
||||||
2: (reply: ArrayReply<NullReply | BlobStringReply>) => {
|
2: (reply: ArrayReply<NullReply | BlobStringReply>) => {
|
||||||
return reply.map(score => score === null ? null : Number(score));
|
return reply.map(transformNullableDoubleReply[2]);
|
||||||
},
|
},
|
||||||
3: undefined as unknown as () => ArrayReply<NullReply | DoubleReply>
|
3: undefined as unknown as () => ArrayReply<NullReply | DoubleReply>
|
||||||
}
|
}
|
||||||
|
@@ -1,41 +1,39 @@
|
|||||||
// import { strict as assert } from 'assert';
|
import { strict as assert } from 'assert';
|
||||||
// import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
// import { transformArguments, transformReply } from './ZPOPMAX';
|
import ZPOPMAX from './ZPOPMAX';
|
||||||
|
|
||||||
// describe('ZPOPMAX', () => {
|
describe('ZPOPMAX', () => {
|
||||||
// it('transformArguments', () => {
|
it('transformArguments', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('key'),
|
ZPOPMAX.transformArguments('key'),
|
||||||
// ['ZPOPMAX', 'key']
|
['ZPOPMAX', 'key']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('transformReply', () => {
|
testUtils.testAll('zPopMax - null', async client => {
|
||||||
// assert.deepEqual(
|
assert.equal(
|
||||||
// transformReply(['value', '1']),
|
await client.zPopMax('key'),
|
||||||
// {
|
null
|
||||||
// value: 'value',
|
);
|
||||||
// score: 1
|
}, {
|
||||||
// }
|
client: GLOBAL.SERVERS.OPEN,
|
||||||
// );
|
cluster: GLOBAL.SERVERS.OPEN
|
||||||
// });
|
});
|
||||||
|
|
||||||
// describe('client.zPopMax', () => {
|
testUtils.testAll('zPopMax - with member', async client => {
|
||||||
// testUtils.testWithClient('null', async client => {
|
const member = {
|
||||||
// assert.equal(
|
value: 'value',
|
||||||
// await client.zPopMax('key'),
|
score: 1
|
||||||
// null
|
};
|
||||||
// );
|
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
|
||||||
|
|
||||||
// testUtils.testWithClient('member', async client => {
|
const [, reply] = await Promise.all([
|
||||||
// const member = { score: 1, value: 'value' },
|
client.zAdd('key', member),
|
||||||
// [, zPopMaxReply] = await Promise.all([
|
client.zPopMax('key')
|
||||||
// client.zAdd('key', member),
|
]);
|
||||||
// client.zPopMax('key')
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// assert.deepEqual(zPopMaxReply, member);
|
assert.deepEqual(reply, member);
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
}, {
|
||||||
// });
|
client: GLOBAL.SERVERS.OPEN,
|
||||||
// });
|
cluster: GLOBAL.SERVERS.OPEN
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@@ -1,12 +1,11 @@
|
|||||||
// import { RedisCommandArgument, RedisCommandArguments } from '.';
|
import { RedisArgument, NullReply, TuplesReply, BlobStringReply, DoubleReply, Command } from '../RESP/types';
|
||||||
|
import ZPOPMIN from './ZPOPMIN';
|
||||||
|
|
||||||
// export const FIRST_KEY_INDEX = 1;
|
export default {
|
||||||
|
FIRST_KEY_INDEX: 1,
|
||||||
// export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
|
IS_READ_ONLY: false,
|
||||||
// return [
|
transformArguments(key: RedisArgument) {
|
||||||
// 'ZPOPMAX',
|
return ['ZPOPMAX', key];
|
||||||
// key
|
},
|
||||||
// ];
|
transformReply: ZPOPMIN.transformReply
|
||||||
// }
|
} as const satisfies Command;
|
||||||
|
|
||||||
// export { transformSortedSetMemberNullReply as transformReply } from './generic-transformers';
|
|
||||||
|
@@ -1,19 +1,29 @@
|
|||||||
// import { strict as assert } from 'assert';
|
import { strict as assert } from 'assert';
|
||||||
// import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
// import { transformArguments } from './ZPOPMAX_COUNT';
|
import ZPOPMAX_COUNT from './ZPOPMAX_COUNT';
|
||||||
|
|
||||||
// describe('ZPOPMAX COUNT', () => {
|
describe('ZPOPMAX COUNT', () => {
|
||||||
// it('transformArguments', () => {
|
it('transformArguments', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('key', 1),
|
ZPOPMAX_COUNT.transformArguments('key', 1),
|
||||||
// ['ZPOPMAX', 'key', '1']
|
['ZPOPMAX', 'key', '1']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// testUtils.testWithClient('client.zPopMaxCount', async client => {
|
testUtils.testAll('zPopMaxCount', async client => {
|
||||||
// assert.deepEqual(
|
const members = [{
|
||||||
// await client.zPopMaxCount('key', 1),
|
value: '1',
|
||||||
// []
|
score: 1
|
||||||
// );
|
}];
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
|
||||||
// });
|
const [ , reply] = await Promise.all([
|
||||||
|
client.zAdd('key', members),
|
||||||
|
client.zPopMaxCount('key', 1)
|
||||||
|
]);
|
||||||
|
|
||||||
|
assert.deepEqual(reply, members);
|
||||||
|
}, {
|
||||||
|
client: GLOBAL.SERVERS.OPEN,
|
||||||
|
cluster: GLOBAL.SERVERS.OPEN
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@@ -1,16 +1,11 @@
|
|||||||
// import { RedisCommandArgument, RedisCommandArguments } from '.';
|
import { RedisArgument, Command } from '../RESP/types';
|
||||||
// import { transformArguments as transformZPopMaxArguments } from './ZPOPMAX';
|
import { transformSortedSetReply } from './generic-transformers';
|
||||||
|
|
||||||
// export { FIRST_KEY_INDEX } from './ZPOPMAX';
|
export default {
|
||||||
|
FIRST_KEY_INDEX: undefined,
|
||||||
// export function transformArguments(
|
IS_READ_ONLY: false,
|
||||||
// key: RedisCommandArgument,
|
transformArguments(key: RedisArgument, count: number) {
|
||||||
// count: number
|
return ['ZPOPMAX', key, count.toString()];
|
||||||
// ): RedisCommandArguments {
|
},
|
||||||
// return [
|
transformReply: transformSortedSetReply
|
||||||
// ...transformZPopMaxArguments(key),
|
} as const satisfies Command;
|
||||||
// count.toString()
|
|
||||||
// ];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers';
|
|
||||||
|
@@ -1,41 +1,39 @@
|
|||||||
// import { strict as assert } from 'assert';
|
import { strict as assert } from 'assert';
|
||||||
// import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
// import { transformArguments, transformReply } from './ZPOPMIN';
|
import ZPOPMIN from './ZPOPMIN';
|
||||||
|
|
||||||
// describe('ZPOPMIN', () => {
|
describe('ZPOPMIN', () => {
|
||||||
// it('transformArguments', () => {
|
it('transformArguments', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('key'),
|
ZPOPMIN.transformArguments('key'),
|
||||||
// ['ZPOPMIN', 'key']
|
['ZPOPMIN', 'key']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('transformReply', () => {
|
testUtils.testAll('zPopMin - null', async client => {
|
||||||
// assert.deepEqual(
|
assert.equal(
|
||||||
// transformReply(['value', '1']),
|
await client.zPopMin('key'),
|
||||||
// {
|
null
|
||||||
// value: 'value',
|
);
|
||||||
// score: 1
|
}, {
|
||||||
// }
|
client: GLOBAL.SERVERS.OPEN,
|
||||||
// );
|
cluster: GLOBAL.SERVERS.OPEN
|
||||||
// });
|
});
|
||||||
|
|
||||||
// describe('client.zPopMin', () => {
|
testUtils.testAll('zPopMax - with member', async client => {
|
||||||
// testUtils.testWithClient('null', async client => {
|
const member = {
|
||||||
// assert.equal(
|
value: 'value',
|
||||||
// await client.zPopMin('key'),
|
score: 1
|
||||||
// null
|
};
|
||||||
// );
|
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
|
||||||
|
|
||||||
// testUtils.testWithClient('member', async client => {
|
const [, reply] = await Promise.all([
|
||||||
// const member = { score: 1, value: 'value' },
|
client.zAdd('key', member),
|
||||||
// [, zPopMinReply] = await Promise.all([
|
client.zPopMin('key')
|
||||||
// client.zAdd('key', member),
|
]);
|
||||||
// client.zPopMin('key')
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// assert.deepEqual(zPopMinReply, member);
|
assert.deepEqual(reply, member);
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
}, {
|
||||||
// });
|
client: GLOBAL.SERVERS.OPEN,
|
||||||
// });
|
cluster: GLOBAL.SERVERS.OPEN
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@@ -1,12 +1,27 @@
|
|||||||
// import { RedisCommandArgument, RedisCommandArguments } from '.';
|
import { RedisArgument, TuplesReply, BlobStringReply, DoubleReply, Command } from '../RESP/types';
|
||||||
|
|
||||||
// export const FIRST_KEY_INDEX = 1;
|
export default {
|
||||||
|
FIRST_KEY_INDEX: 1,
|
||||||
|
IS_READ_ONLY: false,
|
||||||
|
transformArguments(key: RedisArgument) {
|
||||||
|
return ['ZPOPMIN', key];
|
||||||
|
},
|
||||||
|
transformReply: {
|
||||||
|
2: (reply: TuplesReply<[]> | TuplesReply<[BlobStringReply, BlobStringReply]>) => {
|
||||||
|
if (reply.length === 0) return null;
|
||||||
|
|
||||||
// export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
|
return {
|
||||||
// return [
|
value: reply[0],
|
||||||
// 'ZPOPMIN',
|
score: Number(reply[1])
|
||||||
// key
|
};
|
||||||
// ];
|
},
|
||||||
// }
|
3: (reply: TuplesReply<[]> | TuplesReply<[BlobStringReply, DoubleReply]>) => {
|
||||||
|
if (reply.length === 0) return null;
|
||||||
|
|
||||||
// export { transformSortedSetMemberNullReply as transformReply } from './generic-transformers';
|
return {
|
||||||
|
value: reply[0],
|
||||||
|
score: reply[1]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} as const satisfies Command;
|
||||||
|
@@ -1,19 +1,29 @@
|
|||||||
// import { strict as assert } from 'assert';
|
import { strict as assert } from 'assert';
|
||||||
// import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
// import { transformArguments } from './ZPOPMIN_COUNT';
|
import ZPOPMIN_COUNT from './ZPOPMIN_COUNT';
|
||||||
|
|
||||||
// describe('ZPOPMIN COUNT', () => {
|
describe('ZPOPMIN COUNT', () => {
|
||||||
// it('transformArguments', () => {
|
it('transformArguments', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('key', 1),
|
ZPOPMIN_COUNT.transformArguments('key', 1),
|
||||||
// ['ZPOPMIN', 'key', '1']
|
['ZPOPMIN', 'key', '1']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// testUtils.testWithClient('client.zPopMinCount', async client => {
|
testUtils.testAll('zPopMinCount', async client => {
|
||||||
// assert.deepEqual(
|
const members = [{
|
||||||
// await client.zPopMinCount('key', 1),
|
value: '1',
|
||||||
// []
|
score: 1
|
||||||
// );
|
}];
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
|
||||||
// });
|
const [ , reply] = await Promise.all([
|
||||||
|
client.zAdd('key', members),
|
||||||
|
client.zPopMinCount('key', 1)
|
||||||
|
]);
|
||||||
|
|
||||||
|
assert.deepEqual(reply, members);
|
||||||
|
}, {
|
||||||
|
client: GLOBAL.SERVERS.OPEN,
|
||||||
|
cluster: GLOBAL.SERVERS.OPEN
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@@ -1,16 +1,11 @@
|
|||||||
// import { RedisCommandArgument, RedisCommandArguments } from '.';
|
import { RedisArgument, Command } from '../RESP/types';
|
||||||
// import { transformArguments as transformZPopMinArguments } from './ZPOPMIN';
|
import { transformSortedSetReply } from './generic-transformers';
|
||||||
|
|
||||||
// export { FIRST_KEY_INDEX } from './ZPOPMIN';
|
export default {
|
||||||
|
FIRST_KEY_INDEX: undefined,
|
||||||
// export function transformArguments(
|
IS_READ_ONLY: false,
|
||||||
// key: RedisCommandArgument,
|
transformArguments(key: RedisArgument, count: number) {
|
||||||
// count: number
|
return ['ZPOPMIN', key, count.toString()];
|
||||||
// ): RedisCommandArguments {
|
},
|
||||||
// return [
|
transformReply: transformSortedSetReply
|
||||||
// ...transformZPopMinArguments(key),
|
} as const satisfies Command;
|
||||||
// count.toString()
|
|
||||||
// ];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers';
|
|
||||||
|
@@ -1,92 +1,81 @@
|
|||||||
// import { strict as assert } from 'assert';
|
import { strict as assert } from 'assert';
|
||||||
// import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
// import { transformArguments, transformReply } from './ZRANGESTORE';
|
import ZRANGESTORE from './ZRANGESTORE';
|
||||||
|
|
||||||
// describe('ZRANGESTORE', () => {
|
describe('ZRANGESTORE', () => {
|
||||||
// testUtils.isVersionGreaterThanHook([6, 2]);
|
testUtils.isVersionGreaterThanHook([6, 2]);
|
||||||
|
|
||||||
// describe('transformArguments', () => {
|
describe('transformArguments', () => {
|
||||||
// it('simple', () => {
|
it('simple', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('dst', 'src', 0, 1),
|
ZRANGESTORE.transformArguments('destination', 'source', 0, 1),
|
||||||
// ['ZRANGESTORE', 'dst', 'src', '0', '1']
|
['ZRANGESTORE', 'destination', 'source', '0', '1']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with BYSCORE', () => {
|
it('with BYSCORE', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('dst', 'src', 0, 1, {
|
ZRANGESTORE.transformArguments('destination', 'source', 0, 1, {
|
||||||
// BY: 'SCORE'
|
BY: 'SCORE'
|
||||||
// }),
|
}),
|
||||||
// ['ZRANGESTORE', 'dst', 'src', '0', '1', 'BYSCORE']
|
['ZRANGESTORE', 'destination', 'source', '0', '1', 'BYSCORE']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with BYLEX', () => {
|
it('with BYLEX', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('dst', 'src', 0, 1, {
|
ZRANGESTORE.transformArguments('destination', 'source', 0, 1, {
|
||||||
// BY: 'LEX'
|
BY: 'LEX'
|
||||||
// }),
|
}),
|
||||||
// ['ZRANGESTORE', 'dst', 'src', '0', '1', 'BYLEX']
|
['ZRANGESTORE', 'destination', 'source', '0', '1', 'BYLEX']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with REV', () => {
|
it('with REV', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('dst', 'src', 0, 1, {
|
ZRANGESTORE.transformArguments('destination', 'source', 0, 1, {
|
||||||
// REV: true
|
REV: true
|
||||||
// }),
|
}),
|
||||||
// ['ZRANGESTORE', 'dst', 'src', '0', '1', 'REV']
|
['ZRANGESTORE', 'destination', 'source', '0', '1', 'REV']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with LIMIT', () => {
|
it('with LIMIT', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('dst', 'src', 0, 1, {
|
ZRANGESTORE.transformArguments('destination', 'source', 0, 1, {
|
||||||
// LIMIT: {
|
LIMIT: {
|
||||||
// offset: 0,
|
offset: 0,
|
||||||
// count: 1
|
count: 1
|
||||||
// }
|
}
|
||||||
// }),
|
}),
|
||||||
// ['ZRANGESTORE', 'dst', 'src', '0', '1', 'LIMIT', '0', '1']
|
['ZRANGESTORE', 'destination', 'source', '0', '1', 'LIMIT', '0', '1']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with BY & REV & LIMIT', () => {
|
it('with BY & REV & LIMIT', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('dst', 'src', 0, 1, {
|
ZRANGESTORE.transformArguments('destination', 'source', 0, 1, {
|
||||||
// BY: 'SCORE',
|
BY: 'SCORE',
|
||||||
// REV: true,
|
REV: true,
|
||||||
// LIMIT: {
|
LIMIT: {
|
||||||
// offset: 0,
|
offset: 0,
|
||||||
// count: 1
|
count: 1
|
||||||
// },
|
}
|
||||||
// WITHSCORES: true
|
}),
|
||||||
// }),
|
['ZRANGESTORE', 'destination', 'source', '0', '1', 'BYSCORE', 'REV', 'LIMIT', '0', '1']
|
||||||
// ['ZRANGESTORE', 'dst', 'src', '0', '1', 'BYSCORE', 'REV', 'LIMIT', '0', '1', 'WITHSCORES']
|
);
|
||||||
// );
|
});
|
||||||
// });
|
});
|
||||||
// });
|
|
||||||
|
|
||||||
// describe('transformReply', () => {
|
testUtils.testWithClient('client.zRangeStore', async client => {
|
||||||
// it('should throw TypeError when reply is not a number', () => {
|
const [, reply] = await Promise.all([
|
||||||
// assert.throws(
|
client.zAdd('{tag}source', {
|
||||||
// // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
score: 1,
|
||||||
// () => (transformReply as any)([]),
|
value: '1'
|
||||||
// TypeError
|
}),
|
||||||
// );
|
client.zRangeStore('{tag}destination', '{tag}source', 0, 1)
|
||||||
// });
|
]);
|
||||||
// });
|
|
||||||
|
|
||||||
// testUtils.testWithClient('client.zRangeStore', async client => {
|
assert.equal(reply, 1);
|
||||||
// await client.zAdd('src', {
|
}, GLOBAL.SERVERS.OPEN);
|
||||||
// score: 0.5,
|
});
|
||||||
// value: 'value'
|
|
||||||
// });
|
|
||||||
|
|
||||||
// assert.equal(
|
|
||||||
// await client.zRangeStore('dst', 'src', 0, 1),
|
|
||||||
// 1
|
|
||||||
// );
|
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
|
||||||
// });
|
|
||||||
|
@@ -1,62 +1,52 @@
|
|||||||
// import { RedisCommandArgument, RedisCommandArguments } from '.';
|
import { RedisArgument, NumberReply, Command } from '../RESP/types';
|
||||||
// import { transformStringDoubleArgument } from './generic-transformers';
|
import { transformStringDoubleArgument } from './generic-transformers';
|
||||||
|
|
||||||
// export const FIRST_KEY_INDEX = 1;
|
export interface ZRangeStoreOptions {
|
||||||
|
BY?: 'SCORE' | 'LEX';
|
||||||
|
REV?: true;
|
||||||
|
LIMIT?: {
|
||||||
|
offset: number;
|
||||||
|
count: number;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// interface ZRangeStoreOptions {
|
export default {
|
||||||
// BY?: 'SCORE' | 'LEX';
|
FIRST_KEY_INDEX: 1,
|
||||||
// REV?: true;
|
IS_READ_ONLY: false,
|
||||||
// LIMIT?: {
|
transformArguments(
|
||||||
// offset: number;
|
destination: RedisArgument,
|
||||||
// count: number;
|
source: RedisArgument,
|
||||||
// };
|
min: RedisArgument | number,
|
||||||
// WITHSCORES?: true;
|
max: RedisArgument | number,
|
||||||
// }
|
options?: ZRangeStoreOptions
|
||||||
|
) {
|
||||||
|
const args = [
|
||||||
|
'ZRANGESTORE',
|
||||||
|
destination,
|
||||||
|
source,
|
||||||
|
transformStringDoubleArgument(min),
|
||||||
|
transformStringDoubleArgument(max)
|
||||||
|
];
|
||||||
|
|
||||||
// export function transformArguments(
|
switch (options?.BY) {
|
||||||
// dst: RedisCommandArgument,
|
case 'SCORE':
|
||||||
// src: RedisCommandArgument,
|
args.push('BYSCORE');
|
||||||
// min: RedisCommandArgument | number,
|
break;
|
||||||
// max: RedisCommandArgument | number,
|
|
||||||
// options?: ZRangeStoreOptions
|
|
||||||
// ): RedisCommandArguments {
|
|
||||||
// const args = [
|
|
||||||
// 'ZRANGESTORE',
|
|
||||||
// dst,
|
|
||||||
// src,
|
|
||||||
// transformStringDoubleArgument(min),
|
|
||||||
// transformStringDoubleArgument(max)
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// switch (options?.BY) {
|
case 'LEX':
|
||||||
// case 'SCORE':
|
args.push('BYLEX');
|
||||||
// args.push('BYSCORE');
|
break;
|
||||||
// break;
|
}
|
||||||
|
|
||||||
// case 'LEX':
|
if (options?.REV) {
|
||||||
// args.push('BYLEX');
|
args.push('REV');
|
||||||
// break;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
// if (options?.REV) {
|
if (options?.LIMIT) {
|
||||||
// args.push('REV');
|
args.push('LIMIT', options.LIMIT.offset.toString(), options.LIMIT.count.toString());
|
||||||
// }
|
}
|
||||||
|
|
||||||
// if (options?.LIMIT) {
|
return args;
|
||||||
// args.push('LIMIT', options.LIMIT.offset.toString(), options.LIMIT.count.toString());
|
},
|
||||||
// }
|
transformReply: undefined as unknown as () => NumberReply
|
||||||
|
} as const satisfies Command;
|
||||||
// if (options?.WITHSCORES) {
|
|
||||||
// args.push('WITHSCORES');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return args;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export function transformReply(reply: number): number {
|
|
||||||
// if (typeof reply !== 'number') {
|
|
||||||
// throw new TypeError(`Upgrade to Redis 6.2.5 and up (https://github.com/redis/redis/pull/9089)`);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return reply;
|
|
||||||
// }
|
|
||||||
|
@@ -1,65 +1,75 @@
|
|||||||
// import { strict as assert } from 'assert';
|
import { strict as assert } from 'assert';
|
||||||
// import testUtils, { GLOBAL } from '../test-utils';
|
import testUtils, { GLOBAL } from '../test-utils';
|
||||||
// import { transformArguments } from './ZRANGE_WITHSCORES';
|
import ZRANGE_WITHSCORES from './ZRANGE_WITHSCORES';
|
||||||
|
|
||||||
// describe('ZRANGE WITHSCORES', () => {
|
describe('ZRANGE WITHSCORES', () => {
|
||||||
// describe('transformArguments', () => {
|
describe('transformArguments', () => {
|
||||||
// it('simple', () => {
|
it('simple', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('src', 0, 1),
|
ZRANGE_WITHSCORES.transformArguments('src', 0, 1),
|
||||||
// ['ZRANGE', 'src', '0', '1', 'WITHSCORES']
|
['ZRANGE', 'src', '0', '1', 'WITHSCORES']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with BY', () => {
|
it('with BY', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('src', 0, 1, {
|
ZRANGE_WITHSCORES.transformArguments('src', 0, 1, {
|
||||||
// BY: 'SCORE'
|
BY: 'SCORE'
|
||||||
// }),
|
}),
|
||||||
// ['ZRANGE', 'src', '0', '1', 'BYSCORE', 'WITHSCORES']
|
['ZRANGE', 'src', '0', '1', 'BYSCORE', 'WITHSCORES']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with REV', () => {
|
it('with REV', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('src', 0, 1, {
|
ZRANGE_WITHSCORES.transformArguments('src', 0, 1, {
|
||||||
// REV: true
|
REV: true
|
||||||
// }),
|
}),
|
||||||
// ['ZRANGE', 'src', '0', '1', 'REV', 'WITHSCORES']
|
['ZRANGE', 'src', '0', '1', 'REV', 'WITHSCORES']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with LIMIT', () => {
|
it('with LIMIT', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('src', 0, 1, {
|
ZRANGE_WITHSCORES.transformArguments('src', 0, 1, {
|
||||||
// LIMIT: {
|
LIMIT: {
|
||||||
// offset: 0,
|
offset: 0,
|
||||||
// count: 1
|
count: 1
|
||||||
// }
|
}
|
||||||
// }),
|
}),
|
||||||
// ['ZRANGE', 'src', '0', '1', 'LIMIT', '0', '1', 'WITHSCORES']
|
['ZRANGE', 'src', '0', '1', 'LIMIT', '0', '1', 'WITHSCORES']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('with BY & REV & LIMIT', () => {
|
it('with BY & REV & LIMIT', () => {
|
||||||
// assert.deepEqual(
|
assert.deepEqual(
|
||||||
// transformArguments('src', 0, 1, {
|
ZRANGE_WITHSCORES.transformArguments('src', 0, 1, {
|
||||||
// BY: 'SCORE',
|
BY: 'SCORE',
|
||||||
// REV: true,
|
REV: true,
|
||||||
// LIMIT: {
|
LIMIT: {
|
||||||
// offset: 0,
|
offset: 0,
|
||||||
// count: 1
|
count: 1
|
||||||
// }
|
}
|
||||||
// }),
|
}),
|
||||||
// ['ZRANGE', 'src', '0', '1', 'BYSCORE', 'REV', 'LIMIT', '0', '1', 'WITHSCORES']
|
['ZRANGE', 'src', '0', '1', 'BYSCORE', 'REV', 'LIMIT', '0', '1', 'WITHSCORES']
|
||||||
// );
|
);
|
||||||
// });
|
});
|
||||||
// });
|
});
|
||||||
|
|
||||||
// testUtils.testWithClient('client.zRangeWithScores', async client => {
|
testUtils.testAll('zRangeWithScores', async client => {
|
||||||
// assert.deepEqual(
|
const members = [{
|
||||||
// await client.zRangeWithScores('src', 0, 1),
|
value: '1',
|
||||||
// []
|
score: 1
|
||||||
// );
|
}];
|
||||||
// }, GLOBAL.SERVERS.OPEN);
|
|
||||||
// });
|
const [, reply] = await Promise.all([
|
||||||
|
client.zAdd('key', members),
|
||||||
|
client.zRangeWithScores('key', 0, 1)
|
||||||
|
]);
|
||||||
|
|
||||||
|
assert.deepEqual(reply, members);
|
||||||
|
}, {
|
||||||
|
client: GLOBAL.SERVERS.OPEN,
|
||||||
|
cluster: GLOBAL.CLUSTERS.OPEN
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@@ -1,13 +1,15 @@
|
|||||||
// import { RedisCommandArguments } from '.';
|
import { Command } from '../RESP/types';
|
||||||
// import { transformArguments as transformZRangeArguments } from './ZRANGE';
|
import ZRANGE from './ZRANGE';
|
||||||
|
import { transformSortedSetReply } from './generic-transformers';
|
||||||
|
|
||||||
// export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZRANGE';
|
export default {
|
||||||
|
FIRST_KEY_INDEX: ZRANGE.FIRST_KEY_INDEX,
|
||||||
|
IS_READ_ONLY: ZRANGE.IS_READ_ONLY,
|
||||||
|
transformArguments(...args: Parameters<typeof ZRANGE.transformArguments>) {
|
||||||
|
const redisArgs = ZRANGE.transformArguments(...args);
|
||||||
|
redisArgs.push('WITHSCORES');
|
||||||
|
return redisArgs;
|
||||||
|
},
|
||||||
|
transformReply: transformSortedSetReply
|
||||||
|
} as const satisfies Command;
|
||||||
|
|
||||||
// export function transformArguments(...args: Parameters<typeof transformZRangeArguments>): RedisCommandArguments {
|
|
||||||
// return [
|
|
||||||
// ...transformZRangeArguments(...args),
|
|
||||||
// 'WITHSCORES'
|
|
||||||
// ];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers';
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { RedisArgument, BlobStringReply, Command } from '../RESP/types';
|
import { RedisArgument, ArrayReply, BlobStringReply, Command } from '../RESP/types';
|
||||||
import { ScanCommonOptions, pushScanArguments } from './SCAN';
|
import { ScanCommonOptions, pushScanArguments } from './SCAN';
|
||||||
import { ZMember, transformDoubleReply } from './generic-transformers';
|
import { SortedSetMember, transformDoubleReply, transformSortedSetReply } from './generic-transformers';
|
||||||
|
|
||||||
export interface HScanEntry {
|
export interface HScanEntry {
|
||||||
field: BlobStringReply;
|
field: BlobStringReply;
|
||||||
@@ -17,19 +17,10 @@ export default {
|
|||||||
) {
|
) {
|
||||||
return pushScanArguments(['ZSCAN', key], cursor, options);
|
return pushScanArguments(['ZSCAN', key], cursor, options);
|
||||||
},
|
},
|
||||||
transformReply([cursor, rawMembers]: [BlobStringReply, Array<BlobStringReply>]) {
|
transformReply([cursor, rawMembers]: [BlobStringReply, ArrayReply<BlobStringReply>]) {
|
||||||
const members = [];
|
|
||||||
let i = 0;
|
|
||||||
while (i < rawMembers.length) {
|
|
||||||
members.push({
|
|
||||||
value: rawMembers[i++],
|
|
||||||
score: transformDoubleReply(rawMembers[i++])
|
|
||||||
} satisfies ZMember);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
cursor: Number(cursor),
|
cursor: Number(cursor),
|
||||||
members
|
members: transformSortedSetReply[2](rawMembers)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} as const satisfies Command;
|
} as const satisfies Command;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { DoubleReply, NullReply, Command, RedisArgument } from '../RESP/types';
|
import { RedisArgument, Command } from '../RESP/types';
|
||||||
import { transformNullableDoubleReply } from './generic-transformers';
|
import { transformNullableDoubleReply } from './generic-transformers';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -8,8 +8,5 @@ export default {
|
|||||||
transformArguments(key: RedisArgument, member: RedisArgument) {
|
transformArguments(key: RedisArgument, member: RedisArgument) {
|
||||||
return ['ZSCORE', key, member];
|
return ['ZSCORE', key, member];
|
||||||
},
|
},
|
||||||
transformReply: {
|
transformReply: transformNullableDoubleReply
|
||||||
2: transformNullableDoubleReply,
|
|
||||||
3: undefined as unknown as () => DoubleReply | NullReply
|
|
||||||
}
|
|
||||||
} as const satisfies Command;
|
} as const satisfies Command;
|
||||||
|
@@ -1,30 +1,7 @@
|
|||||||
import { ArrayReply, BlobStringReply, CommandArguments, DoubleReply, NullReply, RedisArgument, Resp2Reply } from '../RESP/types';
|
import { ArrayReply, BlobStringReply, CommandArguments, DoubleReply, NullReply, RedisArgument, Resp2Reply, TuplesReply } from '../RESP/types';
|
||||||
|
|
||||||
export type BitValue = 0 | 1;
|
export type BitValue = 0 | 1;
|
||||||
|
|
||||||
export function transformDoubleReply(reply: BlobStringReply): number {
|
|
||||||
switch (reply.toString()) {
|
|
||||||
case '+inf':
|
|
||||||
return Infinity;
|
|
||||||
|
|
||||||
case '-inf':
|
|
||||||
return -Infinity;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return Number(reply);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function transformNullableDoubleReply(reply: BlobStringReply | NullReply): number | null {
|
|
||||||
if (reply === null) return null;
|
|
||||||
|
|
||||||
return transformDoubleReply(reply);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function transformArrayNullableDoubleReply(reply: Array<BlobStringReply | NullReply>): Array<number | null> {
|
|
||||||
return reply.map(transformNullableDoubleReply);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function transformDoubleArgument(num: number): string {
|
export function transformDoubleArgument(num: number): string {
|
||||||
switch (num) {
|
switch (num) {
|
||||||
case Infinity:
|
case Infinity:
|
||||||
@@ -44,6 +21,31 @@ export function transformStringDoubleArgument(num: RedisArgument | number): Redi
|
|||||||
return transformDoubleArgument(num);
|
return transformDoubleArgument(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const transformDoubleReply = {
|
||||||
|
2: (reply: BlobStringReply) => {
|
||||||
|
switch (reply.toString()) {
|
||||||
|
case '+inf':
|
||||||
|
return Infinity;
|
||||||
|
|
||||||
|
case '-inf':
|
||||||
|
return -Infinity;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return Number(reply);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
3: undefined as unknown as () => DoubleReply
|
||||||
|
};
|
||||||
|
|
||||||
|
export const transformNullableDoubleReply = {
|
||||||
|
2: (reply: BlobStringReply | NullReply) => {
|
||||||
|
if (reply === null) return null;
|
||||||
|
|
||||||
|
return transformDoubleReply[2](reply);
|
||||||
|
},
|
||||||
|
3: undefined as unknown as () => DoubleReply | NullReply
|
||||||
|
};
|
||||||
|
|
||||||
export function transformTuplesReply(
|
export function transformTuplesReply(
|
||||||
reply: ArrayReply<BlobStringReply>
|
reply: ArrayReply<BlobStringReply>
|
||||||
): Record<string, BlobStringReply> {
|
): Record<string, BlobStringReply> {
|
||||||
@@ -90,27 +92,12 @@ export function transformStreamsMessagesReply(reply: Array<any> | null): Streams
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ZMember {
|
export interface SortedSetMember {
|
||||||
score: number;
|
|
||||||
value: RedisArgument;
|
value: RedisArgument;
|
||||||
|
score: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function transformSortedSetMemberNullReply(
|
export type SortedSetSide = 'MIN' | 'MAX';
|
||||||
reply: [BlobStringReply, BlobStringReply] | []
|
|
||||||
): ZMember | null {
|
|
||||||
if (!reply.length) return null;
|
|
||||||
|
|
||||||
return transformSortedSetMemberReply(reply);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function transformSortedSetMemberReply(
|
|
||||||
reply: [BlobStringReply, BlobStringReply]
|
|
||||||
): ZMember {
|
|
||||||
return {
|
|
||||||
value: reply[0],
|
|
||||||
score: transformDoubleReply(reply[1])
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export const transformSortedSetReply = {
|
export const transformSortedSetReply = {
|
||||||
2: (reply: ArrayReply<BlobStringReply>) => {
|
2: (reply: ArrayReply<BlobStringReply>) => {
|
||||||
@@ -118,13 +105,13 @@ export const transformSortedSetReply = {
|
|||||||
for (let i = 0; i < reply.length; i += 2) {
|
for (let i = 0; i < reply.length; i += 2) {
|
||||||
members.push({
|
members.push({
|
||||||
value: reply[i],
|
value: reply[i],
|
||||||
score: transformDoubleReply(reply[i + 1])
|
score: transformDoubleReply[2](reply[i + 1])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return members;
|
return members;
|
||||||
},
|
},
|
||||||
3: (reply: ArrayReply<[BlobStringReply, DoubleReply]>) => {
|
3: (reply: ArrayReply<TuplesReply<[BlobStringReply, DoubleReply]>>) => {
|
||||||
return reply.map(([value, score]) => ({
|
return reply.map(([value, score]) => ({
|
||||||
value,
|
value,
|
||||||
score
|
score
|
||||||
@@ -132,44 +119,8 @@ export const transformSortedSetReply = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function transformSortedSetWithScoresReply(reply: ArrayReply<BlobStringReply>): Array<ZMember> {
|
|
||||||
const members = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < reply.length; i += 2) {
|
|
||||||
members.push({
|
|
||||||
value: reply[i],
|
|
||||||
score: transformDoubleReply(reply[i + 1])
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return members;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ListSide = 'LEFT' | 'RIGHT';
|
export type ListSide = 'LEFT' | 'RIGHT';
|
||||||
|
|
||||||
export type SortedSetSide = 'MIN' | 'MAX';
|
|
||||||
|
|
||||||
export interface LMPopOptions {
|
|
||||||
COUNT?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function transformLMPopArguments(
|
|
||||||
args: CommandArguments,
|
|
||||||
keys: RedisVariadicArgument,
|
|
||||||
side: ListSide,
|
|
||||||
options?: LMPopOptions
|
|
||||||
): CommandArguments {
|
|
||||||
pushVariadicArgument(args, keys);
|
|
||||||
|
|
||||||
args.push(side);
|
|
||||||
|
|
||||||
if (options?.COUNT) {
|
|
||||||
args.push('COUNT', options.COUNT.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return args;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function transformEXAT(EXAT: number | Date): string {
|
export function transformEXAT(EXAT: number | Date): string {
|
||||||
return (typeof EXAT === 'number' ? EXAT : Math.floor(EXAT.getTime() / 1000)).toString();
|
return (typeof EXAT === 'number' ? EXAT : Math.floor(EXAT.getTime() / 1000)).toString();
|
||||||
}
|
}
|
||||||
|
@@ -270,14 +270,21 @@ import ZINTER from './ZINTER';
|
|||||||
import ZINTERCARD from './ZINTERCARD';
|
import ZINTERCARD from './ZINTERCARD';
|
||||||
import ZINTERSTORE from './ZINTERSTORE';
|
import ZINTERSTORE from './ZINTERSTORE';
|
||||||
import ZLEXCOUNT from './ZLEXCOUNT';
|
import ZLEXCOUNT from './ZLEXCOUNT';
|
||||||
|
import ZMPOP from './ZMPOP';
|
||||||
import ZMSCORE from './ZMSCORE';
|
import ZMSCORE from './ZMSCORE';
|
||||||
|
import ZPOPMAX_COUNT from './ZPOPMAX_COUNT';
|
||||||
|
import ZPOPMAX from './ZPOPMAX';
|
||||||
|
import ZPOPMIN_COUNT from './ZPOPMIN_COUNT';
|
||||||
|
import ZPOPMIN from './ZPOPMIN';
|
||||||
import ZRANDMEMBER_COUNT_WITHSCORES from './ZRANDMEMBER_COUNT_WITHSCORES';
|
import ZRANDMEMBER_COUNT_WITHSCORES from './ZRANDMEMBER_COUNT_WITHSCORES';
|
||||||
import ZRANDMEMBER_COUNT from './ZRANDMEMBER_COUNT';
|
import ZRANDMEMBER_COUNT from './ZRANDMEMBER_COUNT';
|
||||||
import ZRANDMEMBER from './ZRANDMEMBER';
|
import ZRANDMEMBER from './ZRANDMEMBER';
|
||||||
|
import ZRANGE_WITHSCORES from './ZRANGE_WITHSCORES';
|
||||||
import ZRANGE from './ZRANGE';
|
import ZRANGE from './ZRANGE';
|
||||||
import ZRANGEBYLEX from './ZRANGEBYLEX';
|
import ZRANGEBYLEX from './ZRANGEBYLEX';
|
||||||
import ZRANGEBYSCORE_WITHSCORES from './ZRANGEBYSCORE_WITHSCORES';
|
import ZRANGEBYSCORE_WITHSCORES from './ZRANGEBYSCORE_WITHSCORES';
|
||||||
import ZRANGEBYSCORE from './ZRANGEBYSCORE';
|
import ZRANGEBYSCORE from './ZRANGEBYSCORE';
|
||||||
|
import ZRANGESTORE from './ZRANGESTORE';
|
||||||
import ZREMRANGEBYSCORE from './ZREMRANGEBYSCORE';
|
import ZREMRANGEBYSCORE from './ZREMRANGEBYSCORE';
|
||||||
import ZRANK from './ZRANK';
|
import ZRANK from './ZRANK';
|
||||||
import ZREM from './ZREM';
|
import ZREM from './ZREM';
|
||||||
@@ -563,14 +570,21 @@ type ZINTER = typeof import('./ZINTER').default;
|
|||||||
type ZINTERCARD = typeof import('./ZINTERCARD').default;
|
type ZINTERCARD = typeof import('./ZINTERCARD').default;
|
||||||
type ZINTERSTORE = typeof import('./ZINTERSTORE').default;
|
type ZINTERSTORE = typeof import('./ZINTERSTORE').default;
|
||||||
type ZLEXCOUNT = typeof import('./ZLEXCOUNT').default;
|
type ZLEXCOUNT = typeof import('./ZLEXCOUNT').default;
|
||||||
|
type ZMPOP = typeof import('./ZMPOP').default;
|
||||||
type ZMSCORE = typeof import('./ZMSCORE').default;
|
type ZMSCORE = typeof import('./ZMSCORE').default;
|
||||||
|
type ZPOPMAX_COUNT = typeof import('./ZPOPMAX_COUNT').default;
|
||||||
|
type ZPOPMAX = typeof import('./ZPOPMAX').default;
|
||||||
|
type ZPOPMIN_COUNT = typeof import('./ZPOPMIN_COUNT').default;
|
||||||
|
type ZPOPMIN = typeof import('./ZPOPMIN').default;
|
||||||
type ZRANDMEMBER_COUNT_WITHSCORES = typeof import('./ZRANDMEMBER_COUNT_WITHSCORES').default;
|
type ZRANDMEMBER_COUNT_WITHSCORES = typeof import('./ZRANDMEMBER_COUNT_WITHSCORES').default;
|
||||||
type ZRANDMEMBER_COUNT = typeof import('./ZRANDMEMBER_COUNT').default;
|
type ZRANDMEMBER_COUNT = typeof import('./ZRANDMEMBER_COUNT').default;
|
||||||
type ZRANDMEMBER = typeof import('./ZRANDMEMBER').default;
|
type ZRANDMEMBER = typeof import('./ZRANDMEMBER').default;
|
||||||
|
type ZRANGE_WITHSCORES = typeof import('./ZRANGE_WITHSCORES').default;
|
||||||
type ZRANGE = typeof import('./ZRANGE').default;
|
type ZRANGE = typeof import('./ZRANGE').default;
|
||||||
type ZRANGEBYLEX = typeof import('./ZRANGEBYLEX').default;
|
type ZRANGEBYLEX = typeof import('./ZRANGEBYLEX').default;
|
||||||
type ZRANGEBYSCORE_WITHSCORES = typeof import('./ZRANGEBYSCORE_WITHSCORES').default;
|
type ZRANGEBYSCORE_WITHSCORES = typeof import('./ZRANGEBYSCORE_WITHSCORES').default;
|
||||||
type ZRANGEBYSCORE = typeof import('./ZRANGEBYSCORE').default;
|
type ZRANGEBYSCORE = typeof import('./ZRANGEBYSCORE').default;
|
||||||
|
type ZRANGESTORE = typeof import('./ZRANGESTORE').default;
|
||||||
type ZREMRANGEBYSCORE = typeof import('./ZREMRANGEBYSCORE').default;
|
type ZREMRANGEBYSCORE = typeof import('./ZREMRANGEBYSCORE').default;
|
||||||
type ZRANK = typeof import('./ZRANK').default;
|
type ZRANK = typeof import('./ZRANK').default;
|
||||||
type ZREM = typeof import('./ZREM').default;
|
type ZREM = typeof import('./ZREM').default;
|
||||||
@@ -1130,14 +1144,26 @@ type Commands = {
|
|||||||
zInterStore: ZINTERSTORE;
|
zInterStore: ZINTERSTORE;
|
||||||
ZLEXCOUNT: ZLEXCOUNT;
|
ZLEXCOUNT: ZLEXCOUNT;
|
||||||
zLexCount: ZLEXCOUNT;
|
zLexCount: ZLEXCOUNT;
|
||||||
|
ZMPOP: ZMPOP;
|
||||||
|
zmPop: ZMPOP;
|
||||||
ZMSCORE: ZMSCORE;
|
ZMSCORE: ZMSCORE;
|
||||||
zmScore: ZMSCORE;
|
zmScore: ZMSCORE;
|
||||||
|
ZPOPMAX_COUNT: ZPOPMAX_COUNT;
|
||||||
|
zPopMaxCount: ZPOPMAX_COUNT;
|
||||||
|
ZPOPMAX: ZPOPMAX;
|
||||||
|
zPopMax: ZPOPMAX;
|
||||||
|
ZPOPMIN_COUNT: ZPOPMIN_COUNT;
|
||||||
|
zPopMinCount: ZPOPMIN_COUNT;
|
||||||
|
ZPOPMIN: ZPOPMIN;
|
||||||
|
zPopMin: ZPOPMIN;
|
||||||
ZRANDMEMBER_COUNT_WITHSCORES: ZRANDMEMBER_COUNT_WITHSCORES;
|
ZRANDMEMBER_COUNT_WITHSCORES: ZRANDMEMBER_COUNT_WITHSCORES;
|
||||||
zRandMemberCountWithScores: ZRANDMEMBER_COUNT_WITHSCORES;
|
zRandMemberCountWithScores: ZRANDMEMBER_COUNT_WITHSCORES;
|
||||||
ZRANDMEMBER_COUNT: ZRANDMEMBER_COUNT;
|
ZRANDMEMBER_COUNT: ZRANDMEMBER_COUNT;
|
||||||
zRandMemberCount: ZRANDMEMBER_COUNT;
|
zRandMemberCount: ZRANDMEMBER_COUNT;
|
||||||
ZRANDMEMBER: ZRANDMEMBER;
|
ZRANDMEMBER: ZRANDMEMBER;
|
||||||
zRandMember: ZRANDMEMBER;
|
zRandMember: ZRANDMEMBER;
|
||||||
|
ZRANGE_WITHSCORES: ZRANGE_WITHSCORES;
|
||||||
|
zRangeWithScores: ZRANGE_WITHSCORES;
|
||||||
ZRANGE: ZRANGE;
|
ZRANGE: ZRANGE;
|
||||||
zRange: ZRANGE;
|
zRange: ZRANGE;
|
||||||
ZRANGEBYLEX: ZRANGEBYLEX;
|
ZRANGEBYLEX: ZRANGEBYLEX;
|
||||||
@@ -1146,6 +1172,8 @@ type Commands = {
|
|||||||
zRangeByScoreWithScores: ZRANGEBYSCORE_WITHSCORES;
|
zRangeByScoreWithScores: ZRANGEBYSCORE_WITHSCORES;
|
||||||
ZRANGEBYSCORE: ZRANGEBYSCORE;
|
ZRANGEBYSCORE: ZRANGEBYSCORE;
|
||||||
zRangeByScore: ZRANGEBYSCORE;
|
zRangeByScore: ZRANGEBYSCORE;
|
||||||
|
ZRANGESTORE: ZRANGESTORE;
|
||||||
|
zRangeStore: ZRANGESTORE;
|
||||||
ZRANK: ZRANK;
|
ZRANK: ZRANK;
|
||||||
zRank: ZRANK;
|
zRank: ZRANK;
|
||||||
ZREM: ZREM;
|
ZREM: ZREM;
|
||||||
@@ -1717,14 +1745,26 @@ export default {
|
|||||||
zInterStore: ZINTERSTORE,
|
zInterStore: ZINTERSTORE,
|
||||||
ZLEXCOUNT,
|
ZLEXCOUNT,
|
||||||
zLexCount: ZLEXCOUNT,
|
zLexCount: ZLEXCOUNT,
|
||||||
|
ZMPOP,
|
||||||
|
zmPop: ZMPOP,
|
||||||
ZMSCORE,
|
ZMSCORE,
|
||||||
zmScore: ZMSCORE,
|
zmScore: ZMSCORE,
|
||||||
|
ZPOPMAX_COUNT,
|
||||||
|
zPopMaxCount: ZPOPMAX_COUNT,
|
||||||
|
ZPOPMAX,
|
||||||
|
zPopMax: ZPOPMAX,
|
||||||
|
ZPOPMIN_COUNT,
|
||||||
|
zPopMinCount: ZPOPMIN_COUNT,
|
||||||
|
ZPOPMIN,
|
||||||
|
zPopMin: ZPOPMIN,
|
||||||
ZRANDMEMBER_COUNT_WITHSCORES,
|
ZRANDMEMBER_COUNT_WITHSCORES,
|
||||||
zRandMemberCountWithScores: ZRANDMEMBER_COUNT_WITHSCORES,
|
zRandMemberCountWithScores: ZRANDMEMBER_COUNT_WITHSCORES,
|
||||||
ZRANDMEMBER_COUNT,
|
ZRANDMEMBER_COUNT,
|
||||||
zRandMemberCount: ZRANDMEMBER_COUNT,
|
zRandMemberCount: ZRANDMEMBER_COUNT,
|
||||||
ZRANDMEMBER,
|
ZRANDMEMBER,
|
||||||
zRandMember: ZRANDMEMBER,
|
zRandMember: ZRANDMEMBER,
|
||||||
|
ZRANGE_WITHSCORES,
|
||||||
|
zRangeWithScores: ZRANGE_WITHSCORES,
|
||||||
ZRANGE,
|
ZRANGE,
|
||||||
zRange: ZRANGE,
|
zRange: ZRANGE,
|
||||||
ZRANGEBYLEX,
|
ZRANGEBYLEX,
|
||||||
@@ -1733,6 +1773,8 @@ export default {
|
|||||||
zRangeByScoreWithScores: ZRANGEBYSCORE_WITHSCORES,
|
zRangeByScoreWithScores: ZRANGEBYSCORE_WITHSCORES,
|
||||||
ZRANGEBYSCORE,
|
ZRANGEBYSCORE,
|
||||||
zRangeByScore: ZRANGEBYSCORE,
|
zRangeByScore: ZRANGEBYSCORE,
|
||||||
|
ZRANGESTORE,
|
||||||
|
zRangeStore: ZRANGESTORE,
|
||||||
ZRANK,
|
ZRANK,
|
||||||
zRank: ZRANK,
|
zRank: ZRANK,
|
||||||
ZREM,
|
ZREM,
|
||||||
|
Reference in New Issue
Block a user