@valkey/valkey-glide-darwin-x64 1.3.4 → 255.255.255
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/package.json +31 -95
- package/README.md +0 -106
- package/build-ts/index.d.ts +0 -14
- package/build-ts/index.js +0 -34
- package/build-ts/index.js.map +0 -1
- package/build-ts/src/BaseClient.d.ts +0 -5254
- package/build-ts/src/BaseClient.js +0 -6391
- package/build-ts/src/BaseClient.js.map +0 -1
- package/build-ts/src/Commands.d.ts +0 -1034
- package/build-ts/src/Commands.js +0 -2710
- package/build-ts/src/Commands.js.map +0 -1
- package/build-ts/src/Errors.d.ts +0 -21
- package/build-ts/src/Errors.js +0 -43
- package/build-ts/src/Errors.js.map +0 -1
- package/build-ts/src/GlideClient.d.ts +0 -832
- package/build-ts/src/GlideClient.js +0 -940
- package/build-ts/src/GlideClient.js.map +0 -1
- package/build-ts/src/GlideClusterClient.d.ts +0 -1323
- package/build-ts/src/GlideClusterClient.js +0 -1276
- package/build-ts/src/GlideClusterClient.js.map +0 -1
- package/build-ts/src/Logger.d.ts +0 -32
- package/build-ts/src/Logger.js +0 -68
- package/build-ts/src/Logger.js.map +0 -1
- package/build-ts/src/ProtobufMessage.d.ts +0 -2889
- package/build-ts/src/ProtobufMessage.js +0 -8785
- package/build-ts/src/ProtobufMessage.js.map +0 -1
- package/build-ts/src/Transaction.d.ts +0 -2963
- package/build-ts/src/Transaction.js +0 -3388
- package/build-ts/src/Transaction.js.map +0 -1
- package/build-ts/src/server-modules/GlideFt.d.ts +0 -412
- package/build-ts/src/server-modules/GlideFt.js +0 -664
- package/build-ts/src/server-modules/GlideFt.js.map +0 -1
- package/build-ts/src/server-modules/GlideFtOptions.d.ts +0 -244
- package/build-ts/src/server-modules/GlideFtOptions.js +0 -6
- package/build-ts/src/server-modules/GlideFtOptions.js.map +0 -1
- package/build-ts/src/server-modules/GlideJson.d.ts +0 -1335
- package/build-ts/src/server-modules/GlideJson.js +0 -1628
- package/build-ts/src/server-modules/GlideJson.js.map +0 -1
- package/index.ts +0 -15
- package/node_modules/glide-rs/glide-rs.darwin-x64.node +0 -0
- package/node_modules/glide-rs/index.d.ts +0 -71
- package/node_modules/glide-rs/index.js +0 -317
- package/node_modules/glide-rs/package.json +0 -65
- package/npm/glide/index.ts +0 -391
- package/npm/glide/package.json +0 -67
|
@@ -1,2963 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
3
|
-
*/
|
|
4
|
-
import { // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
-
GlideRecord, GlideString, HashDataType, Score, ElementAndScore } from "./BaseClient";
|
|
6
|
-
import { AggregationType, BaseScanOptions, BitFieldGet, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7
|
-
BitFieldSubCommands, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
8
|
-
BitOffsetOptions, BitwiseOperation, Boundary, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
9
|
-
ExpireOptions, FlushMode, FunctionListOptions, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
10
|
-
FunctionRestorePolicy, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
11
|
-
GeoAddOptions, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
12
|
-
GeoSearchResultOptions, GeoSearchShape, GeoSearchStoreResultOptions, GeoUnit, GeospatialData, HScanOptions, InfoOptions, InsertPosition, KeyWeight, LPosOptions, ListDirection, LolwutOptions, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
13
|
-
RangeByIndex, RangeByLex, RangeByScore, RestoreOptions, ScoreFilter, SearchOrigin, SetOptions, SortOptions, StreamAddOptions, StreamClaimOptions, StreamGroupOptions, StreamPendingOptions, StreamReadGroupOptions, StreamReadOptions, StreamTrimOptions, TimeUnit, ZAddOptions, ZScanOptions } from "./Commands";
|
|
14
|
-
import { command_request } from "./ProtobufMessage";
|
|
15
|
-
/**
|
|
16
|
-
* Base class encompassing shared commands for both standalone and cluster mode implementations in a transaction.
|
|
17
|
-
* Transactions allow the execution of a group of commands in a single step.
|
|
18
|
-
*
|
|
19
|
-
* Command Response:
|
|
20
|
-
* An array of command responses is returned by the client exec command, in the order they were given.
|
|
21
|
-
* Each element in the array represents a command given to the transaction.
|
|
22
|
-
* The response for each command depends on the executed Valkey command.
|
|
23
|
-
* Specific response types are documented alongside each method.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* const transaction = new BaseTransaction()
|
|
28
|
-
* .set("key", "value")
|
|
29
|
-
* .get("key");
|
|
30
|
-
* const result = await client.exec(transaction);
|
|
31
|
-
* console.log(result); // Output: ['OK', 'value']
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare class BaseTransaction<T extends BaseTransaction<T>> {
|
|
35
|
-
/**
|
|
36
|
-
* Adds a command to the transaction and returns the transaction instance.
|
|
37
|
-
* @param command - The command to add.
|
|
38
|
-
* @param shouldConvertToSet - Indicates if the command should be converted to a `Set`.
|
|
39
|
-
* @returns The updated transaction instance.
|
|
40
|
-
*/
|
|
41
|
-
protected addAndReturn(command: command_request.Command, shouldConvertToSet?: boolean): T;
|
|
42
|
-
/** Get the value associated with the given key, or null if no such value exists.
|
|
43
|
-
* @see {@link https://valkey.io/commands/get/|valkey.io} for details.
|
|
44
|
-
*
|
|
45
|
-
* @param key - The key to retrieve from the database.
|
|
46
|
-
*
|
|
47
|
-
* Command Response - If `key` exists, returns the value of `key`. Otherwise, return null.
|
|
48
|
-
*/
|
|
49
|
-
get(key: GlideString): T;
|
|
50
|
-
/**
|
|
51
|
-
* Get the value of `key` and optionally set its expiration. `GETEX` is similar to {@link get}.
|
|
52
|
-
*
|
|
53
|
-
* @see {@link https://valkey.io/commands/getex/|valkey.io} for more details.
|
|
54
|
-
* @remarks Since Valkey version 6.2.0.
|
|
55
|
-
*
|
|
56
|
-
* @param key - The key to retrieve from the database.
|
|
57
|
-
* @param options - (Optional) set expiriation to the given key.
|
|
58
|
-
* "persist" will retain the time to live associated with the key. Equivalent to `PERSIST` in the VALKEY API.
|
|
59
|
-
* Otherwise, a {@link TimeUnit} and duration of the expire time should be specified.
|
|
60
|
-
*
|
|
61
|
-
* Command Response - If `key` exists, returns the value of `key` as a `string`. Otherwise, return `null`.
|
|
62
|
-
*/
|
|
63
|
-
getex(key: GlideString, options?: "persist" | {
|
|
64
|
-
type: TimeUnit;
|
|
65
|
-
duration: number;
|
|
66
|
-
}): T;
|
|
67
|
-
/**
|
|
68
|
-
* Gets a string value associated with the given `key`and deletes the key.
|
|
69
|
-
*
|
|
70
|
-
* @see {@link https://valkey.io/commands/getdel/|valkey.io} for details.
|
|
71
|
-
*
|
|
72
|
-
* @param key - The key to retrieve from the database.
|
|
73
|
-
*
|
|
74
|
-
* Command Response - If `key` exists, returns the `value` of `key`. Otherwise, return `null`.
|
|
75
|
-
*/
|
|
76
|
-
getdel(key: GlideString): T;
|
|
77
|
-
/**
|
|
78
|
-
* Returns the substring of the string value stored at `key`, determined by the byte offsets
|
|
79
|
-
* `start` and `end` (both are inclusive). Negative offsets can be used in order to provide
|
|
80
|
-
* an offset starting from the end of the string. So `-1` means the last character, `-2` the
|
|
81
|
-
* penultimate and so forth. If `key` does not exist, an empty string is returned. If `start`
|
|
82
|
-
* or `end` are out of range, returns the substring within the valid range of the string.
|
|
83
|
-
*
|
|
84
|
-
* @see {@link https://valkey.io/commands/getrange/|valkey.io} for details.
|
|
85
|
-
*
|
|
86
|
-
* @param key - The key of the string.
|
|
87
|
-
* @param start - The starting byte offset.
|
|
88
|
-
* @param end - The ending byte offset.
|
|
89
|
-
*
|
|
90
|
-
* Command Response - substring extracted from the value stored at `key`.
|
|
91
|
-
*/
|
|
92
|
-
getrange(key: GlideString, start: number, end: number): T;
|
|
93
|
-
/** Set the given key with the given value. Return value is dependent on the passed options.
|
|
94
|
-
* @see {@link https://valkey.io/commands/set/|valkey.io} for details.
|
|
95
|
-
*
|
|
96
|
-
* @param key - The key to store.
|
|
97
|
-
* @param value - The value to store with the given key.
|
|
98
|
-
* @param options - The set options.
|
|
99
|
-
*
|
|
100
|
-
* Command Response - If the value is successfully set, return OK.
|
|
101
|
-
* If `value` isn't set because of `onlyIfExists` or `onlyIfDoesNotExist` conditions, return null.
|
|
102
|
-
* If `returnOldValue` is set, return the old value as a string.
|
|
103
|
-
*/
|
|
104
|
-
set(key: GlideString, value: GlideString, options?: SetOptions): T;
|
|
105
|
-
/**
|
|
106
|
-
* Pings the server.
|
|
107
|
-
*
|
|
108
|
-
* @see {@link https://valkey.io/commands/ping/|valkey.io} for details.
|
|
109
|
-
*
|
|
110
|
-
* @param message - (Optional) A message to include in the PING command.
|
|
111
|
-
* - If not provided, the server will respond with `"PONG"`.
|
|
112
|
-
* - If provided, the server will respond with a copy of the message.
|
|
113
|
-
*
|
|
114
|
-
* Command Response - `"PONG"` if `message` is not provided, otherwise return a copy of `message`.
|
|
115
|
-
*/
|
|
116
|
-
ping(message?: GlideString): T;
|
|
117
|
-
/**
|
|
118
|
-
* Gets information and statistics about the server.
|
|
119
|
-
*
|
|
120
|
-
* @see {@link https://valkey.io/commands/info/|valkey.io} for details.
|
|
121
|
-
*
|
|
122
|
-
* @param sections - (Optional) A list of {@link InfoOptions} values specifying which sections of information to retrieve.
|
|
123
|
-
* When no parameter is provided, {@link InfoOptions.Default|Default} is assumed.
|
|
124
|
-
*
|
|
125
|
-
* Command Response - A string containing the information for the sections requested.
|
|
126
|
-
*/
|
|
127
|
-
info(sections?: InfoOptions[]): T;
|
|
128
|
-
/**
|
|
129
|
-
* Removes the specified keys. A key is ignored if it does not exist.
|
|
130
|
-
*
|
|
131
|
-
* @see {@link https://valkey.io/commands/del/|valkey.io} for details.
|
|
132
|
-
*
|
|
133
|
-
* @param keys - A list of keys to be deleted from the database.
|
|
134
|
-
*
|
|
135
|
-
* Command Response - The number of keys that were removed.
|
|
136
|
-
*/
|
|
137
|
-
del(keys: GlideString[]): T;
|
|
138
|
-
/**
|
|
139
|
-
* Serialize the value stored at `key` in a Valkey-specific format and return it to the user.
|
|
140
|
-
*
|
|
141
|
-
* @see {@link https://valkey.io/commands/dump/|valkey.io} for details.
|
|
142
|
-
* @remarks To execute a transaction with a `dump` command, the `exec` command requires `Decoder.Bytes` to handle the response.
|
|
143
|
-
*
|
|
144
|
-
* @param key - The `key` to serialize.
|
|
145
|
-
*
|
|
146
|
-
* Command Response - The serialized value of the data stored at `key`. If `key` does not exist, `null` will be returned.
|
|
147
|
-
*/
|
|
148
|
-
dump(key: GlideString): T;
|
|
149
|
-
/**
|
|
150
|
-
* Create a `key` associated with a `value` that is obtained by deserializing the provided
|
|
151
|
-
* serialized `value` (obtained via {@link dump}).
|
|
152
|
-
*
|
|
153
|
-
* @see {@link https://valkey.io/commands/restore/|valkey.io} for details.
|
|
154
|
-
* @remarks `options.idletime` and `options.frequency` modifiers cannot be set at the same time.
|
|
155
|
-
*
|
|
156
|
-
* @param key - The `key` to create.
|
|
157
|
-
* @param ttl - The expiry time (in milliseconds). If `0`, the `key` will persist.
|
|
158
|
-
* @param value - The serialized value to deserialize and assign to `key`.
|
|
159
|
-
* @param options - (Optional) Restore options {@link RestoreOptions}.
|
|
160
|
-
*
|
|
161
|
-
* Command Response - Return "OK" if the `key` was successfully restored with a `value`.
|
|
162
|
-
*/
|
|
163
|
-
restore(key: GlideString, ttl: number, value: Buffer, options?: RestoreOptions): T;
|
|
164
|
-
/**
|
|
165
|
-
* Gets the name of the connection on which the transaction is being executed.
|
|
166
|
-
*
|
|
167
|
-
* @see {@link https://valkey.io/commands/client-getname/|valkey.io} for details.
|
|
168
|
-
*
|
|
169
|
-
* Command Response - The name of the client connection as a string if a name is set, or null if no name is assigned.
|
|
170
|
-
*/
|
|
171
|
-
clientGetName(): T;
|
|
172
|
-
/**
|
|
173
|
-
* Rewrites the configuration file with the current configuration.
|
|
174
|
-
*
|
|
175
|
-
* @see {@link https://valkey.io/commands/select/|valkey.io} for details.
|
|
176
|
-
*
|
|
177
|
-
* Command Response - "OK" when the configuration was rewritten properly. Otherwise, the transaction fails with an error.
|
|
178
|
-
*/
|
|
179
|
-
configRewrite(): T;
|
|
180
|
-
/**
|
|
181
|
-
* Resets the statistics reported by Valkey using the `INFO` and `LATENCY HISTOGRAM` commands.
|
|
182
|
-
*
|
|
183
|
-
* @see {@link https://valkey.io/commands/config-resetstat/|valkey.io} for details.
|
|
184
|
-
*
|
|
185
|
-
* Command Response - always "OK".
|
|
186
|
-
*/
|
|
187
|
-
configResetStat(): T;
|
|
188
|
-
/** Retrieve the values of multiple keys.
|
|
189
|
-
* @see {@link https://valkey.io/commands/mget/|valkey.io} for details.
|
|
190
|
-
*
|
|
191
|
-
* @param keys - A list of keys to retrieve values for.
|
|
192
|
-
*
|
|
193
|
-
* Command Response - A list of values corresponding to the provided keys. If a key is not found,
|
|
194
|
-
* its corresponding value in the list will be null.
|
|
195
|
-
*/
|
|
196
|
-
mget(keys: GlideString[]): T;
|
|
197
|
-
/** Set multiple keys to multiple values in a single atomic operation.
|
|
198
|
-
* @see {@link https://valkey.io/commands/mset/|valkey.io} for details.
|
|
199
|
-
*
|
|
200
|
-
* @param keysAndValues - A list of key-value pairs to set.
|
|
201
|
-
*
|
|
202
|
-
* Command Response - always "OK".
|
|
203
|
-
*/
|
|
204
|
-
mset(keysAndValues: Record<string, GlideString> | GlideRecord<GlideString>): T;
|
|
205
|
-
/**
|
|
206
|
-
* Sets multiple keys to values if the key does not exist. The operation is atomic, and if one or
|
|
207
|
-
* more keys already exist, the entire operation fails.
|
|
208
|
-
*
|
|
209
|
-
* @see {@link https://valkey.io/commands/msetnx/|valkey.io} for details.
|
|
210
|
-
*
|
|
211
|
-
* @param keysAndValues - A list of key-value pairs to set.
|
|
212
|
-
* Command Response - `true` if all keys were set. `false` if no key was set.
|
|
213
|
-
*/
|
|
214
|
-
msetnx(keysAndValues: Record<string, GlideString> | GlideRecord<GlideString>): T;
|
|
215
|
-
/** Increments the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
216
|
-
* @see {@link https://valkey.io/commands/incr/|valkey.io} for details.
|
|
217
|
-
*
|
|
218
|
-
* @param key - The key to increment its value.
|
|
219
|
-
*
|
|
220
|
-
* Command Response - the value of `key` after the increment.
|
|
221
|
-
*/
|
|
222
|
-
incr(key: GlideString): T;
|
|
223
|
-
/** Increments the number stored at `key` by `amount`. If `key` does not exist, it is set to 0 before performing the operation.
|
|
224
|
-
* @see {@link https://valkey.io/commands/incrby/|valkey.io} for details.
|
|
225
|
-
*
|
|
226
|
-
* @param key - The key to increment its value.
|
|
227
|
-
* @param amount - The amount to increment.
|
|
228
|
-
*
|
|
229
|
-
* Command Response - the value of `key` after the increment.
|
|
230
|
-
*/
|
|
231
|
-
incrBy(key: GlideString, amount: number): T;
|
|
232
|
-
/** Increment the string representing a floating point number stored at `key` by `amount`.
|
|
233
|
-
* By using a negative amount value, the result is that the value stored at `key` is decremented.
|
|
234
|
-
* If `key` does not exist, it is set to 0 before performing the operation.
|
|
235
|
-
* @see {@link https://valkey.io/commands/incrbyfloat/|valkey.io} for details.
|
|
236
|
-
*
|
|
237
|
-
* @param key - The key to increment its value.
|
|
238
|
-
* @param amount - The amount to increment.
|
|
239
|
-
*
|
|
240
|
-
* Command Response - the value of `key` after the increment.
|
|
241
|
-
*
|
|
242
|
-
*/
|
|
243
|
-
incrByFloat(key: GlideString, amount: number): T;
|
|
244
|
-
/**
|
|
245
|
-
* Returns the current connection ID.
|
|
246
|
-
*
|
|
247
|
-
* @see {@link https://valkey.io/commands/client-id/|valkey.io} for details.
|
|
248
|
-
*
|
|
249
|
-
* Command Response - The ID of the connection.
|
|
250
|
-
*/
|
|
251
|
-
clientId(): T;
|
|
252
|
-
/** Decrements the number stored at `key` by one. If `key` does not exist, it is set to 0 before performing the operation.
|
|
253
|
-
* @see {@link https://valkey.io/commands/decr/|valkey.io} for details.
|
|
254
|
-
*
|
|
255
|
-
* @param key - The key to decrement its value.
|
|
256
|
-
*
|
|
257
|
-
* Command Response - the value of `key` after the decrement.
|
|
258
|
-
*/
|
|
259
|
-
decr(key: GlideString): T;
|
|
260
|
-
/** Decrements the number stored at `key` by `amount`. If `key` does not exist, it is set to 0 before performing the operation.
|
|
261
|
-
* @see {@link https://valkey.io/commands/decrby/|valkey.io} for details.
|
|
262
|
-
*
|
|
263
|
-
* @param key - The key to decrement its value.
|
|
264
|
-
* @param amount - The amount to decrement.
|
|
265
|
-
*
|
|
266
|
-
* Command Response - the value of `key` after the decrement.
|
|
267
|
-
*/
|
|
268
|
-
decrBy(key: GlideString, amount: number): T;
|
|
269
|
-
/**
|
|
270
|
-
* Perform a bitwise operation between multiple keys (containing string values) and store the result in the
|
|
271
|
-
* `destination`.
|
|
272
|
-
*
|
|
273
|
-
* @see {@link https://valkey.io/commands/bitop/|valkey.io} for details.
|
|
274
|
-
*
|
|
275
|
-
* @param operation - The bitwise operation to perform.
|
|
276
|
-
* @param destination - The key that will store the resulting string.
|
|
277
|
-
* @param keys - The list of keys to perform the bitwise operation on.
|
|
278
|
-
*
|
|
279
|
-
* Command Response - The size of the string stored in `destination`.
|
|
280
|
-
*/
|
|
281
|
-
bitop(operation: BitwiseOperation, destination: GlideString, keys: GlideString[]): T;
|
|
282
|
-
/**
|
|
283
|
-
* Returns the bit value at `offset` in the string value stored at `key`. `offset` must be greater than or equal
|
|
284
|
-
* to zero.
|
|
285
|
-
*
|
|
286
|
-
* @see {@link https://valkey.io/commands/getbit/|valkey.io} for details.
|
|
287
|
-
*
|
|
288
|
-
* @param key - The key of the string.
|
|
289
|
-
* @param offset - The index of the bit to return.
|
|
290
|
-
*
|
|
291
|
-
* Command Response - The bit at the given `offset` of the string. Returns `0` if the key is empty or if the
|
|
292
|
-
* `offset` exceeds the length of the string.
|
|
293
|
-
*/
|
|
294
|
-
getbit(key: GlideString, offset: number): T;
|
|
295
|
-
/**
|
|
296
|
-
* Sets or clears the bit at `offset` in the string value stored at `key`. The `offset` is a zero-based index, with
|
|
297
|
-
* `0` being the first element of the list, `1` being the next element, and so on. The `offset` must be less than
|
|
298
|
-
* `2^32` and greater than or equal to `0`. If a key is non-existent then the bit at `offset` is set to `value` and
|
|
299
|
-
* the preceding bits are set to `0`.
|
|
300
|
-
*
|
|
301
|
-
* @see {@link https://valkey.io/commands/setbit/|valkey.io} for details.
|
|
302
|
-
*
|
|
303
|
-
* @param key - The key of the string.
|
|
304
|
-
* @param offset - The index of the bit to be set.
|
|
305
|
-
* @param value - The bit value to set at `offset`. The value must be `0` or `1`.
|
|
306
|
-
*
|
|
307
|
-
* Command Response - The bit value that was previously stored at `offset`.
|
|
308
|
-
*/
|
|
309
|
-
setbit(key: GlideString, offset: number, value: number): T;
|
|
310
|
-
/**
|
|
311
|
-
* Returns the position of the first bit matching the given `bit` value. The optional starting offset
|
|
312
|
-
* `start` is a zero-based index, with `0` being the first byte of the list, `1` being the next byte and so on.
|
|
313
|
-
* The offset can also be a negative number indicating an offset starting at the end of the list, with `-1` being
|
|
314
|
-
* the last byte of the list, `-2` being the penultimate, and so on.
|
|
315
|
-
*
|
|
316
|
-
* @see {@link https://valkey.io/commands/bitpos/|valkey.io} for details.
|
|
317
|
-
*
|
|
318
|
-
* @param key - The key of the string.
|
|
319
|
-
* @param bit - The bit value to match. Must be `0` or `1`.
|
|
320
|
-
* @param options - (Optional) The {@link BitOffsetOptions}.
|
|
321
|
-
*
|
|
322
|
-
* Command Response - The position of the first occurrence of `bit` in the binary value of the string held at `key`.
|
|
323
|
-
* If `start` was provided, the search begins at the offset indicated by `start`.
|
|
324
|
-
*/
|
|
325
|
-
bitpos(key: GlideString, bit: number, options?: BitOffsetOptions): T;
|
|
326
|
-
/**
|
|
327
|
-
* Reads or modifies the array of bits representing the string that is held at `key` based on the specified
|
|
328
|
-
* `subcommands`.
|
|
329
|
-
*
|
|
330
|
-
* @see {@link https://valkey.io/commands/bitfield/|valkey.io} for details.
|
|
331
|
-
*
|
|
332
|
-
* @param key - The key of the string.
|
|
333
|
-
* @param subcommands - The subcommands to be performed on the binary value of the string at `key`, which could be
|
|
334
|
-
* any of the following:
|
|
335
|
-
*
|
|
336
|
-
* - {@link BitFieldGet}
|
|
337
|
-
* - {@link BitFieldSet}
|
|
338
|
-
* - {@link BitFieldIncrBy}
|
|
339
|
-
* - {@link BitFieldOverflow}
|
|
340
|
-
*
|
|
341
|
-
* Command Response - An array of results from the executed subcommands:
|
|
342
|
-
*
|
|
343
|
-
* - {@link BitFieldGet} returns the value in {@link BitOffset} or {@link BitOffsetMultiplier}.
|
|
344
|
-
* - {@link BitFieldSet} returns the old value in {@link BitOffset} or {@link BitOffsetMultiplier}.
|
|
345
|
-
* - {@link BitFieldIncrBy} returns the new value in {@link BitOffset} or {@link BitOffsetMultiplier}.
|
|
346
|
-
* - {@link BitFieldOverflow} determines the behavior of the {@link BitFieldSet} and {@link BitFieldIncrBy}
|
|
347
|
-
* subcommands when an overflow or underflow occurs. {@link BitFieldOverflow} does not return a value and
|
|
348
|
-
* does not contribute a value to the array response.
|
|
349
|
-
*/
|
|
350
|
-
bitfield(key: GlideString, subcommands: BitFieldSubCommands[]): T;
|
|
351
|
-
/**
|
|
352
|
-
* Reads the array of bits representing the string that is held at `key` based on the specified `subcommands`.
|
|
353
|
-
*
|
|
354
|
-
* @see {@link https://valkey.io/commands/bitfield_ro/|valkey.io} for details.
|
|
355
|
-
* @remarks Since Valkey version 6.0.0.
|
|
356
|
-
*
|
|
357
|
-
* @param key - The key of the string.
|
|
358
|
-
* @param subcommands - The {@link BitFieldGet} subcommands to be performed.
|
|
359
|
-
*
|
|
360
|
-
* Command Response - An array of results from the {@link BitFieldGet} subcommands.
|
|
361
|
-
*
|
|
362
|
-
*/
|
|
363
|
-
bitfieldReadOnly(key: GlideString, subcommands: BitFieldGet[]): T;
|
|
364
|
-
/**
|
|
365
|
-
* Reads the configuration parameters of the running server.
|
|
366
|
-
* Starting from server version 7, command supports multiple parameters.
|
|
367
|
-
*
|
|
368
|
-
* @see {@link https://valkey.io/commands/config-get/|valkey.io} for details.
|
|
369
|
-
*
|
|
370
|
-
* @param parameters - A list of configuration parameter names to retrieve values for.
|
|
371
|
-
*
|
|
372
|
-
* Command Response - A map of values corresponding to the configuration parameters.
|
|
373
|
-
*
|
|
374
|
-
*/
|
|
375
|
-
configGet(parameters: string[]): T;
|
|
376
|
-
/**
|
|
377
|
-
* Sets configuration parameters to the specified values.
|
|
378
|
-
* Starting from server version 7, command supports multiple parameters.
|
|
379
|
-
*
|
|
380
|
-
* @see {@link https://valkey.io/commands/config-set/|valkey.io} for details.
|
|
381
|
-
*
|
|
382
|
-
* @param parameters - A map consisting of configuration parameters and their respective values to set.
|
|
383
|
-
*
|
|
384
|
-
* Command Response - "OK" when the configuration was set properly. Otherwise, the transaction fails with an error.
|
|
385
|
-
*/
|
|
386
|
-
configSet(parameters: Record<string, GlideString>): T;
|
|
387
|
-
/** Retrieve the value associated with `field` in the hash stored at `key`.
|
|
388
|
-
* @see {@link https://valkey.io/commands/hget/|valkey.io} for details.
|
|
389
|
-
*
|
|
390
|
-
* @param key - The key of the hash.
|
|
391
|
-
* @param field - The field in the hash stored at `key` to retrieve from the database.
|
|
392
|
-
*
|
|
393
|
-
* Command Response - the value associated with `field`, or null when `field` is not present in the hash or `key` does not exist.
|
|
394
|
-
*/
|
|
395
|
-
hget(key: GlideString, field: GlideString): T;
|
|
396
|
-
/** Sets the specified fields to their respective values in the hash stored at `key`.
|
|
397
|
-
* @see {@link https://valkey.io/commands/hset/|valkey.io} for details.
|
|
398
|
-
*
|
|
399
|
-
* @param key - The key of the hash.
|
|
400
|
-
* @param fieldValueList - A list of field names and their values.
|
|
401
|
-
* to be set in the hash stored at the specified key.
|
|
402
|
-
*
|
|
403
|
-
* Command Response - The number of fields that were added.
|
|
404
|
-
*/
|
|
405
|
-
hset(key: GlideString, fieldsAndValues: HashDataType | Record<string, GlideString>): T;
|
|
406
|
-
/**
|
|
407
|
-
* Returns all field names in the hash stored at `key`.
|
|
408
|
-
*
|
|
409
|
-
* @see {@link https://valkey.io/commands/hkeys/|valkey.io} for details.
|
|
410
|
-
*
|
|
411
|
-
* @param key - The key of the hash.
|
|
412
|
-
*
|
|
413
|
-
* Command Response - A list of field names for the hash, or an empty list when the key does not exist.
|
|
414
|
-
*/
|
|
415
|
-
hkeys(key: GlideString): T;
|
|
416
|
-
/** Sets `field` in the hash stored at `key` to `value`, only if `field` does not yet exist.
|
|
417
|
-
* If `key` does not exist, a new key holding a hash is created.
|
|
418
|
-
* If `field` already exists, this operation has no effect.
|
|
419
|
-
* @see {@link https://valkey.io/commands/hsetnx/|valkey.io} for details.
|
|
420
|
-
*
|
|
421
|
-
* @param key - The key of the hash.
|
|
422
|
-
* @param field - The field to set the value for.
|
|
423
|
-
* @param value - The value to set.
|
|
424
|
-
*
|
|
425
|
-
* Command Response - `true` if the field was set, `false` if the field already existed and was not set.
|
|
426
|
-
*/
|
|
427
|
-
hsetnx(key: GlideString, field: GlideString, value: GlideString): T;
|
|
428
|
-
/** Removes the specified fields from the hash stored at `key`.
|
|
429
|
-
* Specified fields that do not exist within this hash are ignored.
|
|
430
|
-
* @see {@link https://valkey.io/commands/hdel/|valkey.io} for details.
|
|
431
|
-
*
|
|
432
|
-
* @param key - The key of the hash.
|
|
433
|
-
* @param fields - The fields to remove from the hash stored at `key`.
|
|
434
|
-
*
|
|
435
|
-
* Command Response - the number of fields that were removed from the hash, not including specified but non existing fields.
|
|
436
|
-
* If `key` does not exist, it is treated as an empty hash and it returns 0.
|
|
437
|
-
*/
|
|
438
|
-
hdel(key: GlideString, fields: GlideString[]): T;
|
|
439
|
-
/** Returns the values associated with the specified fields in the hash stored at `key`.
|
|
440
|
-
* @see {@link https://valkey.io/commands/hmget/|valkey.io} for details.
|
|
441
|
-
*
|
|
442
|
-
* @param key - The key of the hash.
|
|
443
|
-
* @param fields - The fields in the hash stored at `key` to retrieve from the database.
|
|
444
|
-
*
|
|
445
|
-
* Command Response - a list of values associated with the given fields, in the same order as they are requested.
|
|
446
|
-
* For every field that does not exist in the hash, a null value is returned.
|
|
447
|
-
* If `key` does not exist, it is treated as an empty hash and it returns a list of null values.
|
|
448
|
-
*/
|
|
449
|
-
hmget(key: GlideString, fields: GlideString[]): T;
|
|
450
|
-
/** Returns if `field` is an existing field in the hash stored at `key`.
|
|
451
|
-
* @see {@link https://valkey.io/commands/hexists/|valkey.io} for details.
|
|
452
|
-
*
|
|
453
|
-
* @param key - The key of the hash.
|
|
454
|
-
* @param field - The field to check in the hash stored at `key`.
|
|
455
|
-
*
|
|
456
|
-
* Command Response - `true` if the hash contains `field`. If the hash does not contain `field`, or if `key` does not exist,
|
|
457
|
-
* the command response will be `false`.
|
|
458
|
-
*/
|
|
459
|
-
hexists(key: GlideString, field: GlideString): T;
|
|
460
|
-
/**
|
|
461
|
-
* Returns all fields and values of the hash stored at `key`.
|
|
462
|
-
*
|
|
463
|
-
* @see {@link https://valkey.io/commands/hgetall/|valkey.io} for details.
|
|
464
|
-
*
|
|
465
|
-
* @param key - The key of the hash.
|
|
466
|
-
*
|
|
467
|
-
* Command Response - A list of fields and their values stored in the hash.
|
|
468
|
-
* If `key` does not exist, it returns an empty list.
|
|
469
|
-
*/
|
|
470
|
-
hgetall(key: GlideString): T;
|
|
471
|
-
/** Increments the number stored at `field` in the hash stored at `key` by `increment`.
|
|
472
|
-
* By using a negative increment value, the value stored at `field` in the hash stored at `key` is decremented.
|
|
473
|
-
* If `field` or `key` does not exist, it is set to 0 before performing the operation.
|
|
474
|
-
* @see {@link https://valkey.io/commands/hincrby/|valkey.io} for details.
|
|
475
|
-
*
|
|
476
|
-
* @param key - The key of the hash.
|
|
477
|
-
* @param amount - The amount to increment.
|
|
478
|
-
* @param field - The field in the hash stored at `key` to increment its value.
|
|
479
|
-
*
|
|
480
|
-
* Command Response - the value of `field` in the hash stored at `key` after the increment.
|
|
481
|
-
*/
|
|
482
|
-
hincrBy(key: GlideString, field: GlideString, amount: number): T;
|
|
483
|
-
/** Increment the string representing a floating point number stored at `field` in the hash stored at `key` by `increment`.
|
|
484
|
-
* By using a negative increment value, the value stored at `field` in the hash stored at `key` is decremented.
|
|
485
|
-
* If `field` or `key` does not exist, it is set to 0 before performing the operation.
|
|
486
|
-
* @see {@link https://valkey.io/commands/hincrbyfloat/|valkey.io} for details.
|
|
487
|
-
*
|
|
488
|
-
* @param key - The key of the hash.
|
|
489
|
-
* @param amount - The amount to increment.
|
|
490
|
-
* @param field - The field in the hash stored at `key` to increment its value.
|
|
491
|
-
*
|
|
492
|
-
* Command Response - the value of `field` in the hash stored at `key` after the increment.
|
|
493
|
-
*/
|
|
494
|
-
hincrByFloat(key: GlideString, field: GlideString, amount: number): T;
|
|
495
|
-
/** Returns the number of fields contained in the hash stored at `key`.
|
|
496
|
-
* @see {@link https://valkey.io/commands/hlen/|valkey.io} for details.
|
|
497
|
-
*
|
|
498
|
-
* @param key - The key of the hash.
|
|
499
|
-
*
|
|
500
|
-
* Command Response - The number of fields in the hash, or 0 when the key does not exist.
|
|
501
|
-
*/
|
|
502
|
-
hlen(key: GlideString): T;
|
|
503
|
-
/** Returns all values in the hash stored at key.
|
|
504
|
-
* @see {@link https://valkey.io/commands/hvals/|valkey.io} for details.
|
|
505
|
-
*
|
|
506
|
-
* @param key - The key of the hash.
|
|
507
|
-
*
|
|
508
|
-
* Command Response - a list of values in the hash, or an empty list when the key does not exist.
|
|
509
|
-
*/
|
|
510
|
-
hvals(key: GlideString): T;
|
|
511
|
-
/**
|
|
512
|
-
* Returns the string length of the value associated with `field` in the hash stored at `key`.
|
|
513
|
-
*
|
|
514
|
-
* @see {@link https://valkey.io/commands/hstrlen/|valkey.io} for details.
|
|
515
|
-
*
|
|
516
|
-
* @param key - The key of the hash.
|
|
517
|
-
* @param field - The field in the hash.
|
|
518
|
-
*
|
|
519
|
-
* Command Response - The string length or `0` if `field` or `key` does not exist.
|
|
520
|
-
*/
|
|
521
|
-
hstrlen(key: GlideString, field: GlideString): T;
|
|
522
|
-
/**
|
|
523
|
-
* Returns a random field name from the hash value stored at `key`.
|
|
524
|
-
*
|
|
525
|
-
* @see {@link https://valkey.io/commands/hrandfield/|valkey.io} for details.
|
|
526
|
-
* @remarks Since Valkey version 6.2.0.
|
|
527
|
-
*
|
|
528
|
-
* @param key - The key of the hash.
|
|
529
|
-
*
|
|
530
|
-
* Command Response - A random field name from the hash stored at `key`, or `null` when
|
|
531
|
-
* the key does not exist.
|
|
532
|
-
*/
|
|
533
|
-
hrandfield(key: GlideString): T;
|
|
534
|
-
/**
|
|
535
|
-
* Iterates incrementally over a hash.
|
|
536
|
-
*
|
|
537
|
-
* @see {@link https://valkey.io/commands/hscan/|valkey.io} for more details.
|
|
538
|
-
*
|
|
539
|
-
* @param key - The key of the set.
|
|
540
|
-
* @param cursor - The cursor that points to the next iteration of results. A value of `"0"` indicates the start of the search.
|
|
541
|
-
* @param options - (Optional) The {@link HScanOptions}.
|
|
542
|
-
*
|
|
543
|
-
* Command Response - An array of the `cursor` and the subset of the hash held by `key`.
|
|
544
|
-
* The first element is always the `cursor` for the next iteration of results. `"0"` will be the `cursor`
|
|
545
|
-
* returned on the last iteration of the hash. The second element is always an array of the subset of the
|
|
546
|
-
* hash held in `key`. The array in the second element is a flattened series of string pairs,
|
|
547
|
-
* where the value is at even indices and the value is at odd indices.
|
|
548
|
-
* If `options.noValues` is set to `true`, the second element will only contain the fields without the values.
|
|
549
|
-
*/
|
|
550
|
-
hscan(key: GlideString, cursor: string, options?: HScanOptions): T;
|
|
551
|
-
/**
|
|
552
|
-
* Retrieves up to `count` random field names from the hash value stored at `key`.
|
|
553
|
-
*
|
|
554
|
-
* @see {@link https://valkey.io/commands/hrandfield/|valkey.io} for details.
|
|
555
|
-
* @remarks Since Valkey version 6.2.0.
|
|
556
|
-
*
|
|
557
|
-
* @param key - The key of the hash.
|
|
558
|
-
* @param count - The number of field names to return.
|
|
559
|
-
*
|
|
560
|
-
* If `count` is positive, returns unique elements. If negative, allows for duplicates.
|
|
561
|
-
*
|
|
562
|
-
* Command Response - An `array` of random field names from the hash stored at `key`,
|
|
563
|
-
* or an `empty array` when the key does not exist.
|
|
564
|
-
*/
|
|
565
|
-
hrandfieldCount(key: GlideString, count: number): T;
|
|
566
|
-
/**
|
|
567
|
-
* Retrieves up to `count` random field names along with their values from the hash
|
|
568
|
-
* value stored at `key`.
|
|
569
|
-
*
|
|
570
|
-
* @see {@link https://valkey.io/commands/hrandfield/|valkey.io} for details.
|
|
571
|
-
* @remarks Since Valkey version 6.2.0.
|
|
572
|
-
*
|
|
573
|
-
* @param key - The key of the hash.
|
|
574
|
-
* @param count - The number of field names to return.
|
|
575
|
-
*
|
|
576
|
-
* If `count` is positive, returns unique elements. If negative, allows for duplicates.
|
|
577
|
-
*
|
|
578
|
-
* Command Response - A 2D `array` of `[fieldName, value]` `arrays`, where `fieldName` is a random
|
|
579
|
-
* field name from the hash and `value` is the associated value of the field name.
|
|
580
|
-
* If the hash does not exist or is empty, the response will be an empty `array`.
|
|
581
|
-
*/
|
|
582
|
-
hrandfieldWithValues(key: GlideString, count: number): T;
|
|
583
|
-
/** Inserts all the specified values at the head of the list stored at `key`.
|
|
584
|
-
* `elements` are inserted one after the other to the head of the list, from the leftmost element to the rightmost element.
|
|
585
|
-
* If `key` does not exist, it is created as empty list before performing the push operations.
|
|
586
|
-
* @see {@link https://valkey.io/commands/lpush/|valkey.io} for details.
|
|
587
|
-
*
|
|
588
|
-
* @param key - The key of the list.
|
|
589
|
-
* @param elements - The elements to insert at the head of the list stored at `key`.
|
|
590
|
-
*
|
|
591
|
-
* Command Response - the length of the list after the push operations.
|
|
592
|
-
*/
|
|
593
|
-
lpush(key: GlideString, elements: GlideString[]): T;
|
|
594
|
-
/**
|
|
595
|
-
* Inserts specified values at the head of the `list`, only if `key` already
|
|
596
|
-
* exists and holds a list.
|
|
597
|
-
*
|
|
598
|
-
* @see {@link https://valkey.io/commands/lpushx/|valkey.io} for details.
|
|
599
|
-
*
|
|
600
|
-
* @param key - The key of the list.
|
|
601
|
-
* @param elements - The elements to insert at the head of the list stored at `key`.
|
|
602
|
-
*
|
|
603
|
-
* Command Response - The length of the list after the push operation.
|
|
604
|
-
*/
|
|
605
|
-
lpushx(key: GlideString, elements: GlideString[]): T;
|
|
606
|
-
/** Removes and returns the first elements of the list stored at `key`.
|
|
607
|
-
* The command pops a single element from the beginning of the list.
|
|
608
|
-
* @see {@link https://valkey.io/commands/lpop/|valkey.io} for details.
|
|
609
|
-
*
|
|
610
|
-
* @param key - The key of the list.
|
|
611
|
-
*
|
|
612
|
-
* Command Response - The value of the first element.
|
|
613
|
-
* If `key` does not exist null will be returned.
|
|
614
|
-
*/
|
|
615
|
-
lpop(key: GlideString): T;
|
|
616
|
-
/** Removes and returns up to `count` elements of the list stored at `key`, depending on the list's length.
|
|
617
|
-
* @see {@link https://valkey.io/commands/lpop/|valkey.io} for details.
|
|
618
|
-
*
|
|
619
|
-
* @param key - The key of the list.
|
|
620
|
-
* @param count - The count of the elements to pop from the list.
|
|
621
|
-
*
|
|
622
|
-
* Command Response - A list of the popped elements will be returned depending on the list's length.
|
|
623
|
-
* If `key` does not exist null will be returned.
|
|
624
|
-
*/
|
|
625
|
-
lpopCount(key: GlideString, count: number): T;
|
|
626
|
-
/** Returns the specified elements of the list stored at `key`.
|
|
627
|
-
* The offsets `start` and `end` are zero-based indexes, with 0 being the first element of the list, 1 being the next element and so on.
|
|
628
|
-
* These offsets can also be negative numbers indicating offsets starting at the end of the list,
|
|
629
|
-
* with -1 being the last element of the list, -2 being the penultimate, and so on.
|
|
630
|
-
* @see {@link https://valkey.io/commands/lrange/|valkey.io} for details.
|
|
631
|
-
*
|
|
632
|
-
* @param key - The key of the list.
|
|
633
|
-
* @param start - The starting point of the range.
|
|
634
|
-
* @param end - The end of the range.
|
|
635
|
-
*
|
|
636
|
-
* Command Response - list of elements in the specified range.
|
|
637
|
-
* If `start` exceeds the end of the list, or if `start` is greater than `end`, an empty list will be returned.
|
|
638
|
-
* If `end` exceeds the actual end of the list, the range will stop at the actual end of the list.
|
|
639
|
-
* If `key` does not exist an empty list will be returned.
|
|
640
|
-
*/
|
|
641
|
-
lrange(key: GlideString, start: number, end: number): T;
|
|
642
|
-
/** Returns the length of the list stored at `key`.
|
|
643
|
-
* @see {@link https://valkey.io/commands/llen/|valkey.io} for details.
|
|
644
|
-
*
|
|
645
|
-
* @param key - The key of the list.
|
|
646
|
-
*
|
|
647
|
-
* Command Response - the length of the list at `key`.
|
|
648
|
-
* If `key` does not exist, it is interpreted as an empty list and 0 is returned.
|
|
649
|
-
*/
|
|
650
|
-
llen(key: GlideString): T;
|
|
651
|
-
/**
|
|
652
|
-
* Atomically pops and removes the left/right-most element to the list stored at `source`
|
|
653
|
-
* depending on `whereFrom`, and pushes the element at the first/last element of the list
|
|
654
|
-
* stored at `destination` depending on `whereTo`, see {@link ListDirection}.
|
|
655
|
-
*
|
|
656
|
-
* @see {@link https://valkey.io/commands/lmove/|valkey.io} for details.
|
|
657
|
-
* @remarks Since Valkey version 6.2.0.
|
|
658
|
-
*
|
|
659
|
-
* @param source - The key to the source list.
|
|
660
|
-
* @param destination - The key to the destination list.
|
|
661
|
-
* @param whereFrom - The {@link ListDirection} to remove the element from.
|
|
662
|
-
* @param whereTo - The {@link ListDirection} to add the element to.
|
|
663
|
-
*
|
|
664
|
-
* Command Response - The popped element, or `null` if `source` does not exist.
|
|
665
|
-
*/
|
|
666
|
-
lmove(source: GlideString, destination: GlideString, whereFrom: ListDirection, whereTo: ListDirection): T;
|
|
667
|
-
/**
|
|
668
|
-
*
|
|
669
|
-
* Blocks the connection until it pops atomically and removes the left/right-most element to the
|
|
670
|
-
* list stored at `source` depending on `whereFrom`, and pushes the element at the first/last element
|
|
671
|
-
* of the list stored at `destination` depending on `whereTo`.
|
|
672
|
-
* `BLMOVE` is the blocking variant of {@link lmove}.
|
|
673
|
-
*
|
|
674
|
-
* @see {@link https://valkey.io/commands/blmove/|valkey.io} for details.
|
|
675
|
-
* @remarks When in cluster mode, both `source` and `destination` must map to the same hash slot.
|
|
676
|
-
* @remarks `BLMOVE` is a client blocking command, see {@link https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#blocking-commands|Valkey Glide Wiki} for more details and best practices.
|
|
677
|
-
* @remarks Since Valkey version 6.2.0.
|
|
678
|
-
*
|
|
679
|
-
* @param source - The key to the source list.
|
|
680
|
-
* @param destination - The key to the destination list.
|
|
681
|
-
* @param whereFrom - The {@link ListDirection} to remove the element from.
|
|
682
|
-
* @param whereTo - The {@link ListDirection} to add the element to.
|
|
683
|
-
* @param timeout - The number of seconds to wait for a blocking operation to complete. A value of `0` will block indefinitely.
|
|
684
|
-
*
|
|
685
|
-
* Command Response - The popped element, or `null` if `source` does not exist or if the operation timed-out.
|
|
686
|
-
*/
|
|
687
|
-
blmove(source: GlideString, destination: GlideString, whereFrom: ListDirection, whereTo: ListDirection, timeout: number): T;
|
|
688
|
-
/**
|
|
689
|
-
* Sets the list element at `index` to `element`.
|
|
690
|
-
* The index is zero-based, so `0` means the first element, `1` the second element and so on.
|
|
691
|
-
* Negative indices can be used to designate elements starting at the tail of
|
|
692
|
-
* the list. Here, `-1` means the last element, `-2` means the penultimate and so forth.
|
|
693
|
-
*
|
|
694
|
-
* @see {@link https://valkey.io/commands/lset/|valkey.io} for details.
|
|
695
|
-
*
|
|
696
|
-
* @param key - The key of the list.
|
|
697
|
-
* @param index - The index of the element in the list to be set.
|
|
698
|
-
* @param element - The new element to set at the specified index.
|
|
699
|
-
*
|
|
700
|
-
* Command Response - Always "OK".
|
|
701
|
-
*/
|
|
702
|
-
lset(key: GlideString, index: number, element: GlideString): T;
|
|
703
|
-
/** Trim an existing list so that it will contain only the specified range of elements specified.
|
|
704
|
-
* The offsets `start` and `end` are zero-based indexes, with 0 being the first element of the list, 1 being the next element and so on.
|
|
705
|
-
* These offsets can also be negative numbers indicating offsets starting at the end of the list,
|
|
706
|
-
* with -1 being the last element of the list, -2 being the penultimate, and so on.
|
|
707
|
-
* @see {@link https://valkey.io/commands/ltrim/|valkey.io} for details.
|
|
708
|
-
*
|
|
709
|
-
* @param key - The key of the list.
|
|
710
|
-
* @param start - The starting point of the range.
|
|
711
|
-
* @param end - The end of the range.
|
|
712
|
-
*
|
|
713
|
-
* Command Response - always "OK".
|
|
714
|
-
* If `start` exceeds the end of the list, or if `start` is greater than `end`, the result will be an empty list (which causes key to be removed).
|
|
715
|
-
* If `end` exceeds the actual end of the list, it will be treated like the last element of the list.
|
|
716
|
-
* If `key` does not exist the command will be ignored.
|
|
717
|
-
*/
|
|
718
|
-
ltrim(key: GlideString, start: number, end: number): T;
|
|
719
|
-
/** Removes the first `count` occurrences of elements equal to `element` from the list stored at `key`.
|
|
720
|
-
* If `count` is positive : Removes elements equal to `element` moving from head to tail.
|
|
721
|
-
* If `count` is negative : Removes elements equal to `element` moving from tail to head.
|
|
722
|
-
* If `count` is 0 or `count` is greater than the occurrences of elements equal to `element`: Removes all elements equal to `element`.
|
|
723
|
-
*
|
|
724
|
-
* @param key - The key of the list.
|
|
725
|
-
* @param count - The count of the occurrences of elements equal to `element` to remove.
|
|
726
|
-
* @param element - The element to remove from the list.
|
|
727
|
-
*
|
|
728
|
-
* Command Response - the number of the removed elements.
|
|
729
|
-
* If `key` does not exist, 0 is returned.
|
|
730
|
-
*/
|
|
731
|
-
lrem(key: GlideString, count: number, element: GlideString): T;
|
|
732
|
-
/** Inserts all the specified values at the tail of the list stored at `key`.
|
|
733
|
-
* `elements` are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element.
|
|
734
|
-
* If `key` does not exist, it is created as empty list before performing the push operations.
|
|
735
|
-
* @see {@link https://valkey.io/commands/rpush/|valkey.io} for details.
|
|
736
|
-
*
|
|
737
|
-
* @param key - The key of the list.
|
|
738
|
-
* @param elements - The elements to insert at the tail of the list stored at `key`.
|
|
739
|
-
*
|
|
740
|
-
* Command Response - the length of the list after the push operations.
|
|
741
|
-
*/
|
|
742
|
-
rpush(key: GlideString, elements: GlideString[]): T;
|
|
743
|
-
/**
|
|
744
|
-
* Inserts specified values at the tail of the `list`, only if `key` already
|
|
745
|
-
* exists and holds a list.
|
|
746
|
-
*
|
|
747
|
-
* @see {@link https://valkey.io/commands/rpushx/|valkey.io} for details.
|
|
748
|
-
*
|
|
749
|
-
* @param key - The key of the list.
|
|
750
|
-
* @param elements - The elements to insert at the tail of the list stored at `key`.
|
|
751
|
-
*
|
|
752
|
-
* Command Response - The length of the list after the push operation.
|
|
753
|
-
*/
|
|
754
|
-
rpushx(key: GlideString, elements: GlideString[]): T;
|
|
755
|
-
/** Removes and returns the last elements of the list stored at `key`.
|
|
756
|
-
* The command pops a single element from the end of the list.
|
|
757
|
-
* @see {@link https://valkey.io/commands/rpop/|valkey.io} for details.
|
|
758
|
-
*
|
|
759
|
-
* @param key - The key of the list.
|
|
760
|
-
*
|
|
761
|
-
* Command Response - The value of the last element.
|
|
762
|
-
* If `key` does not exist null will be returned.
|
|
763
|
-
*/
|
|
764
|
-
rpop(key: GlideString): T;
|
|
765
|
-
/** Removes and returns up to `count` elements from the list stored at `key`, depending on the list's length.
|
|
766
|
-
* @see {@link https://valkey.io/commands/rpop/|valkey.io} for details.
|
|
767
|
-
*
|
|
768
|
-
* @param key - The key of the list.
|
|
769
|
-
* @param count - The count of the elements to pop from the list.
|
|
770
|
-
*
|
|
771
|
-
* Command Response - A list of popped elements will be returned depending on the list's length.
|
|
772
|
-
* If `key` does not exist null will be returned.
|
|
773
|
-
*/
|
|
774
|
-
rpopCount(key: GlideString, count: number): T;
|
|
775
|
-
/** Adds the specified members to the set stored at `key`. Specified members that are already a member of this set are ignored.
|
|
776
|
-
* If `key` does not exist, a new set is created before adding `members`.
|
|
777
|
-
* @see {@link https://valkey.io/commands/sadd/|valkey.io} for details.
|
|
778
|
-
*
|
|
779
|
-
* @param key - The key to store the members to its set.
|
|
780
|
-
* @param members - A list of members to add to the set stored at `key`.
|
|
781
|
-
*
|
|
782
|
-
* Command Response - the number of members that were added to the set, not including all the members already present in the set.
|
|
783
|
-
*/
|
|
784
|
-
sadd(key: GlideString, members: GlideString[]): T;
|
|
785
|
-
/** Removes the specified members from the set stored at `key`. Specified members that are not a member of this set are ignored.
|
|
786
|
-
* @see {@link https://valkey.io/commands/srem/|valkey.io} for details.
|
|
787
|
-
*
|
|
788
|
-
* @param key - The key to remove the members from its set.
|
|
789
|
-
* @param members - A list of members to remove from the set stored at `key`.
|
|
790
|
-
*
|
|
791
|
-
* Command Response - the number of members that were removed from the set, not including non existing members.
|
|
792
|
-
* If `key` does not exist, it is treated as an empty set and this command returns 0.
|
|
793
|
-
*/
|
|
794
|
-
srem(key: GlideString, members: GlideString[]): T;
|
|
795
|
-
/**
|
|
796
|
-
* Iterates incrementally over a set.
|
|
797
|
-
*
|
|
798
|
-
* @see {@link https://valkey.io/commands/sscan} for details.
|
|
799
|
-
*
|
|
800
|
-
* @param key - The key of the set.
|
|
801
|
-
* @param cursor - The cursor that points to the next iteration of results. A value of `"0"` indicates the start of the search.
|
|
802
|
-
* @param options - The (Optional) {@link BaseScanOptions}.
|
|
803
|
-
*
|
|
804
|
-
* Command Response - An array of the cursor and the subset of the set held by `key`. The first element is always the `cursor` and for the next iteration of results.
|
|
805
|
-
* The `cursor` will be `"0"` on the last iteration of the set. The second element is always an array of the subset of the set held in `key`.
|
|
806
|
-
*/
|
|
807
|
-
sscan(key: GlideString, cursor: GlideString, options?: BaseScanOptions): T;
|
|
808
|
-
/** Returns all the members of the set value stored at `key`.
|
|
809
|
-
* @see {@link https://valkey.io/commands/smembers/|valkey.io} for details.
|
|
810
|
-
*
|
|
811
|
-
* @param key - The key to return its members.
|
|
812
|
-
*
|
|
813
|
-
* Command Response - all members of the set.
|
|
814
|
-
* If `key` does not exist, it is treated as an empty set and this command returns empty list.
|
|
815
|
-
*/
|
|
816
|
-
smembers(key: GlideString): T;
|
|
817
|
-
/** Moves `member` from the set at `source` to the set at `destination`, removing it from the source set.
|
|
818
|
-
* Creates a new destination set if needed. The operation is atomic.
|
|
819
|
-
* @see {@link https://valkey.io/commands/smove/|valkey.io} for more details.
|
|
820
|
-
*
|
|
821
|
-
* @param source - The key of the set to remove the element from.
|
|
822
|
-
* @param destination - The key of the set to add the element to.
|
|
823
|
-
* @param member - The set element to move.
|
|
824
|
-
*
|
|
825
|
-
* Command Response - `true` on success, or `false` if the `source` set does not exist or the element is not a member of the source set.
|
|
826
|
-
*/
|
|
827
|
-
smove(source: GlideString, destination: GlideString, member: GlideString): T;
|
|
828
|
-
/** Returns the set cardinality (number of elements) of the set stored at `key`.
|
|
829
|
-
* @see {@link https://valkey.io/commands/scard/|valkey.io} for details.
|
|
830
|
-
*
|
|
831
|
-
* @param key - The key to return the number of its members.
|
|
832
|
-
*
|
|
833
|
-
* Command Response - the cardinality (number of elements) of the set, or 0 if key does not exist.
|
|
834
|
-
*/
|
|
835
|
-
scard(key: GlideString): T;
|
|
836
|
-
/** Gets the intersection of all the given sets.
|
|
837
|
-
* When in cluster mode, all `keys` must map to the same hash slot.
|
|
838
|
-
* @see {@link https://valkey.io/commands/sinter/|valkey.io} for details.
|
|
839
|
-
*
|
|
840
|
-
* @param keys - The `keys` of the sets to get the intersection.
|
|
841
|
-
*
|
|
842
|
-
* Command Response - A set of members which are present in all given sets.
|
|
843
|
-
* If one or more sets do not exist, an empty set will be returned.
|
|
844
|
-
*/
|
|
845
|
-
sinter(keys: GlideString[]): T;
|
|
846
|
-
/**
|
|
847
|
-
* Gets the cardinality of the intersection of all the given sets.
|
|
848
|
-
*
|
|
849
|
-
* @see {@link https://valkey.io/commands/sintercard/|valkey.io} for details.
|
|
850
|
-
* @remarks Since Valkey version 7.0.0.
|
|
851
|
-
*
|
|
852
|
-
* @param keys - The keys of the sets.
|
|
853
|
-
* @param options - (Optional) Additional parameters:
|
|
854
|
-
* - (Optional) `limit`: the limit for the intersection cardinality value. If not specified, or set to `0`, no limit is used.
|
|
855
|
-
*
|
|
856
|
-
* Command Response - The cardinality of the intersection result. If one or more sets do not exist, `0` is returned.
|
|
857
|
-
*/
|
|
858
|
-
sintercard(keys: GlideString[], options?: {
|
|
859
|
-
limit?: number;
|
|
860
|
-
}): T;
|
|
861
|
-
/**
|
|
862
|
-
* Stores the members of the intersection of all given sets specified by `keys` into a new set at `destination`.
|
|
863
|
-
*
|
|
864
|
-
* @see {@link https://valkey.io/commands/sinterstore/|valkey.io} for details.
|
|
865
|
-
*
|
|
866
|
-
* @param destination - The key of the destination set.
|
|
867
|
-
* @param keys - The keys from which to retrieve the set members.
|
|
868
|
-
*
|
|
869
|
-
* Command Response - The number of elements in the resulting set.
|
|
870
|
-
*/
|
|
871
|
-
sinterstore(destination: GlideString, keys: GlideString[]): T;
|
|
872
|
-
/**
|
|
873
|
-
* Computes the difference between the first set and all the successive sets in `keys`.
|
|
874
|
-
*
|
|
875
|
-
* @see {@link https://valkey.io/commands/sdiff/|valkey.io} for details.
|
|
876
|
-
*
|
|
877
|
-
* @param keys - The keys of the sets to diff.
|
|
878
|
-
*
|
|
879
|
-
* Command Response - A `Set` of elements representing the difference between the sets.
|
|
880
|
-
* If a key in `keys` does not exist, it is treated as an empty set.
|
|
881
|
-
*/
|
|
882
|
-
sdiff(keys: GlideString[]): T;
|
|
883
|
-
/**
|
|
884
|
-
* Stores the difference between the first set and all the successive sets in `keys` into a new set at `destination`.
|
|
885
|
-
*
|
|
886
|
-
* @see {@link https://valkey.io/commands/sdiffstore/|valkey.io} for details.
|
|
887
|
-
*
|
|
888
|
-
* @param destination - The key of the destination set.
|
|
889
|
-
* @param keys - The keys of the sets to diff.
|
|
890
|
-
*
|
|
891
|
-
* Command Response - The number of elements in the resulting set.
|
|
892
|
-
*/
|
|
893
|
-
sdiffstore(destination: GlideString, keys: GlideString[]): T;
|
|
894
|
-
/**
|
|
895
|
-
* Gets the union of all the given sets.
|
|
896
|
-
*
|
|
897
|
-
* @see {@link https://valkey.io/commands/sunion/|valkey.io} for details.
|
|
898
|
-
*
|
|
899
|
-
* @param keys - The keys of the sets.
|
|
900
|
-
*
|
|
901
|
-
* Command Response - A `Set` of members which are present in at least one of the given sets.
|
|
902
|
-
* If none of the sets exist, an empty `Set` will be returned.
|
|
903
|
-
*/
|
|
904
|
-
sunion(keys: GlideString[]): T;
|
|
905
|
-
/**
|
|
906
|
-
* Stores the members of the union of all given sets specified by `keys` into a new set
|
|
907
|
-
* at `destination`.
|
|
908
|
-
*
|
|
909
|
-
* @see {@link https://valkey.io/commands/sunionstore/|valkey.io} for details.
|
|
910
|
-
*
|
|
911
|
-
* @param destination - The key of the destination set.
|
|
912
|
-
* @param keys - The keys from which to retrieve the set members.
|
|
913
|
-
*
|
|
914
|
-
* Command Response - The number of elements in the resulting set.
|
|
915
|
-
*/
|
|
916
|
-
sunionstore(destination: GlideString, keys: GlideString[]): T;
|
|
917
|
-
/** Returns if `member` is a member of the set stored at `key`.
|
|
918
|
-
* @see {@link https://valkey.io/commands/sismember/|valkey.io} for details.
|
|
919
|
-
*
|
|
920
|
-
* @param key - The key of the set.
|
|
921
|
-
* @param member - The member to check for existence in the set.
|
|
922
|
-
*
|
|
923
|
-
* Command Response - `true` if the member exists in the set, `false` otherwise.
|
|
924
|
-
* If `key` doesn't exist, it is treated as an empty set and the command returns `false`.
|
|
925
|
-
*/
|
|
926
|
-
sismember(key: GlideString, member: GlideString): T;
|
|
927
|
-
/**
|
|
928
|
-
* Checks whether each member is contained in the members of the set stored at `key`.
|
|
929
|
-
*
|
|
930
|
-
* @see {@link https://valkey.io/commands/smismember/|valkey.io} for details.
|
|
931
|
-
* @remarks Since Valkey version 6.2.0.
|
|
932
|
-
*
|
|
933
|
-
* @param key - The key of the set to check.
|
|
934
|
-
* @param members - A list of members to check for existence in the set.
|
|
935
|
-
*
|
|
936
|
-
* Command Response - An `array` of `boolean` values, each indicating if the respective member exists in the set.
|
|
937
|
-
*/
|
|
938
|
-
smismember(key: GlideString, members: GlideString[]): T;
|
|
939
|
-
/** Removes and returns one random member from the set value store at `key`.
|
|
940
|
-
* @see {@link https://valkey.io/commands/spop/|valkey.io} for details.
|
|
941
|
-
* To pop multiple members, see `spopCount`.
|
|
942
|
-
*
|
|
943
|
-
* @param key - The key of the set.
|
|
944
|
-
*
|
|
945
|
-
* Command Response - the value of the popped member.
|
|
946
|
-
* If `key` does not exist, null will be returned.
|
|
947
|
-
*/
|
|
948
|
-
spop(key: GlideString): T;
|
|
949
|
-
/** Removes and returns up to `count` random members from the set value store at `key`, depending on the set's length.
|
|
950
|
-
* @see {@link https://valkey.io/commands/spop/|valkey.io} for details.
|
|
951
|
-
*
|
|
952
|
-
* @param key - The key of the set.
|
|
953
|
-
* @param count - The count of the elements to pop from the set.
|
|
954
|
-
*
|
|
955
|
-
* Command Response - A list of popped elements will be returned depending on the set's length.
|
|
956
|
-
* If `key` does not exist, empty list will be returned.
|
|
957
|
-
*/
|
|
958
|
-
spopCount(key: GlideString, count: number): T;
|
|
959
|
-
/** Returns a random element from the set value stored at `key`.
|
|
960
|
-
*
|
|
961
|
-
* @see {@link https://valkey.io/commands/srandmember/|valkey.io} for more details.
|
|
962
|
-
*
|
|
963
|
-
* @param key - The key from which to retrieve the set member.
|
|
964
|
-
* Command Response - A random element from the set, or null if `key` does not exist.
|
|
965
|
-
*/
|
|
966
|
-
srandmember(key: GlideString): T;
|
|
967
|
-
/** Returns one or more random elements from the set value stored at `key`.
|
|
968
|
-
*
|
|
969
|
-
* @see {@link https://valkey.io/commands/srandmember/|valkey.io} for more details.
|
|
970
|
-
*
|
|
971
|
-
* @param key - The key of the sorted set.
|
|
972
|
-
* @param count - The number of members to return.
|
|
973
|
-
* If `count` is positive, returns unique members.
|
|
974
|
-
* If `count` is negative, allows for duplicates members.
|
|
975
|
-
* Command Response - A list of members from the set. If the set does not exist or is empty, an empty list will be returned.
|
|
976
|
-
*/
|
|
977
|
-
srandmemberCount(key: GlideString, count: number): T;
|
|
978
|
-
/**
|
|
979
|
-
* Returns the number of keys in `keys` that exist in the database.
|
|
980
|
-
*
|
|
981
|
-
* @see {@link https://valkey.io/commands/exists/|valkey.io} for details.
|
|
982
|
-
*
|
|
983
|
-
* @param keys - The keys list to check.
|
|
984
|
-
*
|
|
985
|
-
* Command Response - the number of keys that exist. If the same existing key is mentioned in `keys` multiple times,
|
|
986
|
-
* it will be counted multiple times.
|
|
987
|
-
*/
|
|
988
|
-
exists(keys: GlideString[]): T;
|
|
989
|
-
/**
|
|
990
|
-
* Removes the specified keys. A key is ignored if it does not exist.
|
|
991
|
-
* This command, similar to {@link del}, removes specified keys and ignores non-existent ones.
|
|
992
|
-
* However, this command does not block the server, while {@link https://valkey.io/commands/del|`DEL`} does.
|
|
993
|
-
*
|
|
994
|
-
* @see {@link https://valkey.io/commands/unlink/|valkey.io} for details.
|
|
995
|
-
*
|
|
996
|
-
* @param keys - The keys we wanted to unlink.
|
|
997
|
-
*
|
|
998
|
-
* Command Response - The number of keys that were unlinked.
|
|
999
|
-
*/
|
|
1000
|
-
unlink(keys: GlideString[]): T;
|
|
1001
|
-
/**
|
|
1002
|
-
* Sets a timeout on `key` in seconds. After the timeout has expired, the key will automatically be deleted.
|
|
1003
|
-
* If `key` already has an existing expire set, the time to live is updated to the new value.
|
|
1004
|
-
* If `seconds` is non-positive number, the key will be deleted rather than expired.
|
|
1005
|
-
* The timeout will only be cleared by commands that delete or overwrite the contents of `key`.
|
|
1006
|
-
*
|
|
1007
|
-
* @see {@link https://valkey.io/commands/expire/|valkey.io} for details.
|
|
1008
|
-
*
|
|
1009
|
-
* @param key - The key to set timeout on it.
|
|
1010
|
-
* @param seconds - The timeout in seconds.
|
|
1011
|
-
* @param options - (Optional) Additional parameters:
|
|
1012
|
-
* - (Optional) `expireOption`: the expire option - see {@link ExpireOptions}.
|
|
1013
|
-
*
|
|
1014
|
-
* Command Response - `true` if the timeout was set. `false` if the timeout was not set. e.g. key doesn't exist,
|
|
1015
|
-
* or operation skipped due to the provided arguments.
|
|
1016
|
-
*/
|
|
1017
|
-
expire(key: GlideString, seconds: number, options?: {
|
|
1018
|
-
expireOption?: ExpireOptions;
|
|
1019
|
-
}): T;
|
|
1020
|
-
/**
|
|
1021
|
-
* Sets a timeout on `key`. It takes an absolute Unix timestamp (seconds since January 1, 1970) instead of specifying the number of seconds.
|
|
1022
|
-
* A timestamp in the past will delete the key immediately. After the timeout has expired, the key will automatically be deleted.
|
|
1023
|
-
* If `key` already has an existing expire set, the time to live is updated to the new value.
|
|
1024
|
-
* The timeout will only be cleared by commands that delete or overwrite the contents of `key`.
|
|
1025
|
-
*
|
|
1026
|
-
* @see {@link https://valkey.io/commands/expireat/|valkey.io} for details.
|
|
1027
|
-
*
|
|
1028
|
-
* @param key - The key to set timeout on it.
|
|
1029
|
-
* @param unixSeconds - The timeout in an absolute Unix timestamp.
|
|
1030
|
-
* @param options - (Optional) Additional parameters:
|
|
1031
|
-
* - (Optional) `expireOption`: the expire option - see {@link ExpireOptions}.
|
|
1032
|
-
*
|
|
1033
|
-
* Command Response - `true` if the timeout was set. `false` if the timeout was not set. e.g. key doesn't exist,
|
|
1034
|
-
* or operation skipped due to the provided arguments.
|
|
1035
|
-
*/
|
|
1036
|
-
expireAt(key: GlideString, unixSeconds: number, options?: {
|
|
1037
|
-
expireOption?: ExpireOptions;
|
|
1038
|
-
}): T;
|
|
1039
|
-
/**
|
|
1040
|
-
* Returns the absolute Unix timestamp (since January 1, 1970) at which the given `key` will expire, in seconds.
|
|
1041
|
-
* To get the expiration with millisecond precision, use {@link pexpiretime}.
|
|
1042
|
-
*
|
|
1043
|
-
* @see {@link https://valkey.io/commands/expiretime/|valkey.io} for details.
|
|
1044
|
-
* @remarks Since Valkey version 7.0.0.
|
|
1045
|
-
*
|
|
1046
|
-
* @param key - The `key` to determine the expiration value of.
|
|
1047
|
-
*
|
|
1048
|
-
* Command Response - The expiration Unix timestamp in seconds, `-2` if `key` does not exist or `-1` if `key` exists but has no associated expire.
|
|
1049
|
-
*/
|
|
1050
|
-
expireTime(key: GlideString): T;
|
|
1051
|
-
/**
|
|
1052
|
-
* Sets a timeout on `key` in milliseconds. After the timeout has expired, the key will automatically be deleted.
|
|
1053
|
-
* If `key` already has an existing expire set, the time to live is updated to the new value.
|
|
1054
|
-
* If `milliseconds` is non-positive number, the key will be deleted rather than expired.
|
|
1055
|
-
* The timeout will only be cleared by commands that delete or overwrite the contents of `key`.
|
|
1056
|
-
*
|
|
1057
|
-
* @see {@link https://valkey.io/commands/pexpire/|valkey.io} for details.
|
|
1058
|
-
*
|
|
1059
|
-
* @param key - The key to set timeout on it.
|
|
1060
|
-
* @param milliseconds - The timeout in milliseconds.
|
|
1061
|
-
* @param options - (Optional) Additional parameters:
|
|
1062
|
-
* - (Optional) `expireOption`: the expire option - see {@link ExpireOptions}.
|
|
1063
|
-
*
|
|
1064
|
-
* Command Response - `true` if the timeout was set. `false` if the timeout was not set. e.g. key doesn't exist,
|
|
1065
|
-
* or operation skipped due to the provided arguments.
|
|
1066
|
-
*/
|
|
1067
|
-
pexpire(key: GlideString, milliseconds: number, options?: {
|
|
1068
|
-
expireOption?: ExpireOptions;
|
|
1069
|
-
}): T;
|
|
1070
|
-
/**
|
|
1071
|
-
* Sets a timeout on `key`. It takes an absolute Unix timestamp (milliseconds since January 1, 1970) instead of specifying the number of milliseconds.
|
|
1072
|
-
* A timestamp in the past will delete the key immediately. After the timeout has expired, the key will automatically be deleted.
|
|
1073
|
-
* If `key` already has an existing expire set, the time to live is updated to the new value.
|
|
1074
|
-
* The timeout will only be cleared by commands that delete or overwrite the contents of `key`.
|
|
1075
|
-
*
|
|
1076
|
-
* @see {@link https://valkey.io/commands/pexpireat/|valkey.io} for details.
|
|
1077
|
-
*
|
|
1078
|
-
* @param key - The key to set timeout on it.
|
|
1079
|
-
* @param unixMilliseconds - The timeout in an absolute Unix timestamp.
|
|
1080
|
-
* @param options - (Optional) Additional parameters:
|
|
1081
|
-
* - (Optional) `expireOption`: the expire option - see {@link ExpireOptions}.
|
|
1082
|
-
*
|
|
1083
|
-
* Command Response - `true` if the timeout was set. `false` if the timeout was not set. e.g. key doesn't exist,
|
|
1084
|
-
* or operation skipped due to the provided arguments.
|
|
1085
|
-
*/
|
|
1086
|
-
pexpireAt(key: GlideString, unixMilliseconds: number, options?: {
|
|
1087
|
-
expireOption?: ExpireOptions;
|
|
1088
|
-
}): T;
|
|
1089
|
-
/**
|
|
1090
|
-
* Returns the absolute Unix timestamp (since January 1, 1970) at which the given `key` will expire, in milliseconds.
|
|
1091
|
-
*
|
|
1092
|
-
* @see {@link https://valkey.io/commands/pexpiretime/|valkey.io} for details.
|
|
1093
|
-
* @remarks Since Valkey version 7.0.0.
|
|
1094
|
-
*
|
|
1095
|
-
* @param key - The `key` to determine the expiration value of.
|
|
1096
|
-
*
|
|
1097
|
-
* Command Response - The expiration Unix timestamp in seconds, `-2` if `key` does not exist or `-1` if `key` exists but has no associated expire.
|
|
1098
|
-
*/
|
|
1099
|
-
pexpireTime(key: GlideString): T;
|
|
1100
|
-
/**
|
|
1101
|
-
* Returns the remaining time to live of `key` that has a timeout.
|
|
1102
|
-
*
|
|
1103
|
-
* @see {@link https://valkey.io/commands/ttl/|valkey.io} for details.
|
|
1104
|
-
*
|
|
1105
|
-
* @param key - The key to return its timeout.
|
|
1106
|
-
*
|
|
1107
|
-
* Command Response - TTL in seconds, `-2` if `key` does not exist or `-1` if `key` exists but has no associated expire.
|
|
1108
|
-
*/
|
|
1109
|
-
ttl(key: GlideString): T;
|
|
1110
|
-
/**
|
|
1111
|
-
* Adds members with their scores to the sorted set stored at `key`.
|
|
1112
|
-
* If a member is already a part of the sorted set, its score is updated.
|
|
1113
|
-
*
|
|
1114
|
-
* @see {@link https://valkey.io/commands/zadd/|valkey.io} for details.
|
|
1115
|
-
*
|
|
1116
|
-
* @param key - The key of the sorted set.
|
|
1117
|
-
* @param membersAndScores - A list of members and their corresponding scores or a mapping of members to their corresponding scores.
|
|
1118
|
-
* @param options - (Optional) The `ZADD` options - see {@link ZAddOptions}.
|
|
1119
|
-
*
|
|
1120
|
-
* Command Response - The number of elements added to the sorted set.
|
|
1121
|
-
* If {@link ZAddOptions.changed} is set to `true`, returns the number of elements updated in the sorted set.
|
|
1122
|
-
*/
|
|
1123
|
-
zadd(key: GlideString, membersAndScores: ElementAndScore[] | Record<string, Score>, options?: ZAddOptions): T;
|
|
1124
|
-
/**
|
|
1125
|
-
* Increments the score of member in the sorted set stored at `key` by `increment`.
|
|
1126
|
-
* If `member` does not exist in the sorted set, it is added with `increment` as its score (as if its previous score was 0.0).
|
|
1127
|
-
* If `key` does not exist, a new sorted set with the specified member as its sole member is created.
|
|
1128
|
-
*
|
|
1129
|
-
* @see {@link https://valkey.io/commands/zadd/|valkey.io} for details.
|
|
1130
|
-
*
|
|
1131
|
-
* @param key - The key of the sorted set.
|
|
1132
|
-
* @param member - A member in the sorted set to increment.
|
|
1133
|
-
* @param increment - The score to increment the member.
|
|
1134
|
-
* @param options - (Optional) The `ZADD` options - see {@link ZAddOptions}.
|
|
1135
|
-
*
|
|
1136
|
-
* Command Response - The score of the member.
|
|
1137
|
-
* If there was a conflict with the options, the operation aborts and `null` is returned.
|
|
1138
|
-
*/
|
|
1139
|
-
zaddIncr(key: GlideString, member: GlideString, increment: number, options?: ZAddOptions): T;
|
|
1140
|
-
/**
|
|
1141
|
-
* Removes the specified members from the sorted set stored at `key`.
|
|
1142
|
-
* Specified members that are not a member of this set are ignored.
|
|
1143
|
-
*
|
|
1144
|
-
* @see {@link https://valkey.io/commands/zrem/|valkey.io} for details.
|
|
1145
|
-
*
|
|
1146
|
-
* @param key - The key of the sorted set.
|
|
1147
|
-
* @param members - A list of members to remove from the sorted set.
|
|
1148
|
-
*
|
|
1149
|
-
* Command Response - The number of members that were removed from the sorted set, not including non-existing members.
|
|
1150
|
-
* If `key` does not exist, it is treated as an empty sorted set, and this command returns 0.
|
|
1151
|
-
*/
|
|
1152
|
-
zrem(key: GlideString, members: GlideString[]): T;
|
|
1153
|
-
/**
|
|
1154
|
-
* Returns the cardinality (number of elements) of the sorted set stored at `key`.
|
|
1155
|
-
*
|
|
1156
|
-
* @see {@link https://valkey.io/commands/zcard/|valkey.io} for details.
|
|
1157
|
-
*
|
|
1158
|
-
* @param key - The key of the sorted set.
|
|
1159
|
-
*
|
|
1160
|
-
* Command Response - The number of elements in the sorted set.
|
|
1161
|
-
* If `key` does not exist, it is treated as an empty sorted set, and this command returns `0`.
|
|
1162
|
-
*/
|
|
1163
|
-
zcard(key: GlideString): T;
|
|
1164
|
-
/**
|
|
1165
|
-
* Returns the cardinality of the intersection of the sorted sets specified by `keys`.
|
|
1166
|
-
*
|
|
1167
|
-
* @see {@link https://valkey.io/commands/zintercard/|valkey.io} for details.
|
|
1168
|
-
* @remarks Since Valkey version 7.0.0.
|
|
1169
|
-
*
|
|
1170
|
-
* @param keys - The keys of the sorted sets to intersect.
|
|
1171
|
-
* @param options - (Optional) Additional parameters:
|
|
1172
|
-
* - (Optional) `limit`: the limit for the intersection cardinality value. If not specified, or set to `0`, no limit is used.
|
|
1173
|
-
*
|
|
1174
|
-
* Command Response - The cardinality of the intersection of the given sorted sets.
|
|
1175
|
-
*/
|
|
1176
|
-
zintercard(keys: GlideString[], options?: {
|
|
1177
|
-
limit?: number;
|
|
1178
|
-
}): T;
|
|
1179
|
-
/**
|
|
1180
|
-
* Returns the difference between the first sorted set and all the successive sorted sets.
|
|
1181
|
-
* To get the elements with their scores, see {@link zdiffWithScores}.
|
|
1182
|
-
*
|
|
1183
|
-
* @see {@link https://valkey.io/commands/zdiff/|valkey.io} for details.
|
|
1184
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1185
|
-
*
|
|
1186
|
-
* @param keys - The keys of the sorted sets.
|
|
1187
|
-
*
|
|
1188
|
-
* Command Response - An `array` of elements representing the difference between the sorted sets.
|
|
1189
|
-
* If the first key does not exist, it is treated as an empty sorted set, and the command returns an empty `array`.
|
|
1190
|
-
*/
|
|
1191
|
-
zdiff(keys: GlideString[]): T;
|
|
1192
|
-
/**
|
|
1193
|
-
* Returns the difference between the first sorted set and all the successive sorted sets, with the associated
|
|
1194
|
-
* scores.
|
|
1195
|
-
*
|
|
1196
|
-
* @see {@link https://valkey.io/commands/zdiff/|valkey.io} for details.
|
|
1197
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1198
|
-
*
|
|
1199
|
-
* @param keys - The keys of the sorted sets.
|
|
1200
|
-
*
|
|
1201
|
-
* Command Response - A list of elements and their scores representing the difference between the sorted sets.
|
|
1202
|
-
* If the first key does not exist, it is treated as an empty sorted set, and the command returns an empty `array`.
|
|
1203
|
-
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1204
|
-
*/
|
|
1205
|
-
zdiffWithScores(keys: GlideString[]): T;
|
|
1206
|
-
/**
|
|
1207
|
-
* Calculates the difference between the first sorted set and all the successive sorted sets in `keys` and stores
|
|
1208
|
-
* the difference as a sorted set to `destination`, overwriting it if it already exists. Non-existent keys are
|
|
1209
|
-
* treated as empty sets.
|
|
1210
|
-
*
|
|
1211
|
-
* @see {@link https://valkey.io/commands/zdiffstore/|valkey.io} for details.
|
|
1212
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1213
|
-
*
|
|
1214
|
-
* @param destination - The key for the resulting sorted set.
|
|
1215
|
-
* @param keys - The keys of the sorted sets to compare.
|
|
1216
|
-
*
|
|
1217
|
-
* Command Response - The number of members in the resulting sorted set stored at `destination`.
|
|
1218
|
-
*/
|
|
1219
|
-
zdiffstore(destination: GlideString, keys: GlideString[]): T;
|
|
1220
|
-
/**
|
|
1221
|
-
* Returns the score of `member` in the sorted set stored at `key`.
|
|
1222
|
-
*
|
|
1223
|
-
* @see {@link https://valkey.io/commands/zscore/|valkey.io} for details.
|
|
1224
|
-
*
|
|
1225
|
-
* @param key - The key of the sorted set.
|
|
1226
|
-
* @param member - The member whose score is to be retrieved.
|
|
1227
|
-
*
|
|
1228
|
-
* Command Response - The score of the member.
|
|
1229
|
-
* If `member` does not exist in the sorted set, null is returned.
|
|
1230
|
-
* If `key` does not exist, null is returned.
|
|
1231
|
-
*/
|
|
1232
|
-
zscore(key: GlideString, member: GlideString): T;
|
|
1233
|
-
/**
|
|
1234
|
-
* Computes the union of sorted sets given by the specified `keys` and stores the result in `destination`.
|
|
1235
|
-
* If `destination` already exists, it is overwritten. Otherwise, a new sorted set will be created.
|
|
1236
|
-
* To get the result directly, see {@link zunionWithScores}.
|
|
1237
|
-
*
|
|
1238
|
-
* @see {@link https://valkey.io/commands/zunionstore/|valkey.io} for details.
|
|
1239
|
-
* @param destination - The key of the destination sorted set.
|
|
1240
|
-
* @param keys - The keys of the sorted sets with possible formats:
|
|
1241
|
-
* - `GlideString[]` - for keys only.
|
|
1242
|
-
* - `KeyWeight[]` - for weighted keys with their score multipliers.
|
|
1243
|
-
* @param options - (Optional) Additional parameters:
|
|
1244
|
-
* - (Optional) `aggregationType`: the aggregation strategy to apply when combining the scores of elements. See {@link AggregationType}.
|
|
1245
|
-
* If `aggregationType` is not specified, defaults to `AggregationType.SUM`.
|
|
1246
|
-
*
|
|
1247
|
-
* Command Response - The number of elements in the resulting sorted set stored at `destination`.
|
|
1248
|
-
*/
|
|
1249
|
-
zunionstore(destination: GlideString, keys: GlideString[] | KeyWeight[], options?: {
|
|
1250
|
-
aggregationType?: AggregationType;
|
|
1251
|
-
}): T;
|
|
1252
|
-
/**
|
|
1253
|
-
* Returns the scores associated with the specified `members` in the sorted set stored at `key`.
|
|
1254
|
-
*
|
|
1255
|
-
* @see {@link https://valkey.io/commands/zmscore/|valkey.io} for details.
|
|
1256
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1257
|
-
*
|
|
1258
|
-
* @param key - The key of the sorted set.
|
|
1259
|
-
* @param members - A list of members in the sorted set.
|
|
1260
|
-
*
|
|
1261
|
-
* Command Response - An `array` of scores corresponding to `members`.
|
|
1262
|
-
* If a member does not exist in the sorted set, the corresponding value in the list will be `null`.
|
|
1263
|
-
*/
|
|
1264
|
-
zmscore(key: GlideString, members: GlideString[]): T;
|
|
1265
|
-
/**
|
|
1266
|
-
* Returns the number of members in the sorted set stored at `key` with scores between `minScore` and `maxScore`.
|
|
1267
|
-
*
|
|
1268
|
-
* @see {@link https://valkey.io/commands/zcount/|valkey.io} for details.
|
|
1269
|
-
*
|
|
1270
|
-
* @param key - The key of the sorted set.
|
|
1271
|
-
* @param minScore - The minimum score to count from. Can be positive/negative infinity, or specific score and inclusivity.
|
|
1272
|
-
* @param maxScore - The maximum score to count up to. Can be positive/negative infinity, or specific score and inclusivity.
|
|
1273
|
-
*
|
|
1274
|
-
* Command Response - The number of members in the specified score range.
|
|
1275
|
-
* If `key` does not exist, it is treated as an empty sorted set, and the command returns `0`.
|
|
1276
|
-
* If `minScore` is greater than `maxScore`, `0` is returned.
|
|
1277
|
-
*/
|
|
1278
|
-
zcount(key: GlideString, minScore: Boundary<number>, maxScore: Boundary<number>): T;
|
|
1279
|
-
/**
|
|
1280
|
-
* Returns the specified range of elements in the sorted set stored at `key`.
|
|
1281
|
-
* `ZRANGE` can perform different types of range queries: by index (rank), by the score, or by lexicographical order.
|
|
1282
|
-
*
|
|
1283
|
-
* To get the elements with their scores, see {@link zrangeWithScores}.
|
|
1284
|
-
*
|
|
1285
|
-
* @see {@link https://valkey.io/commands/zrange/|valkey.io} for details.
|
|
1286
|
-
*
|
|
1287
|
-
* @param key - The key of the sorted set.
|
|
1288
|
-
* @param rangeQuery - The range query object representing the type of range query to perform.
|
|
1289
|
-
* - For range queries by index (rank), use {@link RangeByIndex}.
|
|
1290
|
-
* - For range queries by lexicographical order, use {@link RangeByLex}.
|
|
1291
|
-
* - For range queries by score, use {@link RangeByScore}.
|
|
1292
|
-
* @param reverse - If `true`, reverses the sorted set, with index `0` as the element with the highest score.
|
|
1293
|
-
*
|
|
1294
|
-
* Command Response - A list of elements within the specified range.
|
|
1295
|
-
* If `key` does not exist, it is treated as an empty sorted set, and the command returns an empty array.
|
|
1296
|
-
*/
|
|
1297
|
-
zrange(key: GlideString, rangeQuery: RangeByScore | RangeByLex | RangeByIndex, reverse?: boolean): T;
|
|
1298
|
-
/**
|
|
1299
|
-
* Returns the specified range of elements with their scores in the sorted set stored at `key`.
|
|
1300
|
-
* Similar to {@link ZRange} but with a `WITHSCORE` flag.
|
|
1301
|
-
*
|
|
1302
|
-
* @see {@link https://valkey.io/commands/zrange/|valkey.io} for details.
|
|
1303
|
-
*
|
|
1304
|
-
* @param key - The key of the sorted set.
|
|
1305
|
-
* @param rangeQuery - The range query object representing the type of range query to perform.
|
|
1306
|
-
* - For range queries by index (rank), use {@link RangeByIndex}.
|
|
1307
|
-
* - For range queries by score, use {@link RangeByScore}.
|
|
1308
|
-
* @param reverse - If `true`, reverses the sorted set, with index `0` as the element with the highest score.
|
|
1309
|
-
*
|
|
1310
|
-
* Command Response - A list of elements and their scores within the specified range.
|
|
1311
|
-
* If `key` does not exist, it is treated as an empty sorted set, and the command returns an empty list.
|
|
1312
|
-
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1313
|
-
*/
|
|
1314
|
-
zrangeWithScores(key: GlideString, rangeQuery: RangeByScore | RangeByIndex, reverse?: boolean): T;
|
|
1315
|
-
/**
|
|
1316
|
-
* Stores a specified range of elements from the sorted set at `source`, into a new
|
|
1317
|
-
* sorted set at `destination`. If `destination` doesn't exist, a new sorted
|
|
1318
|
-
* set is created; if it exists, it's overwritten.
|
|
1319
|
-
*
|
|
1320
|
-
* @see {@link https://valkey.io/commands/zrangestore/|valkey.io} for details.
|
|
1321
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1322
|
-
*
|
|
1323
|
-
* @param destination - The key for the destination sorted set.
|
|
1324
|
-
* @param source - The key of the source sorted set.
|
|
1325
|
-
* @param rangeQuery - The range query object representing the type of range query to perform.
|
|
1326
|
-
* - For range queries by index (rank), use {@link RangeByIndex}.
|
|
1327
|
-
* - For range queries by lexicographical order, use {@link RangeByLex}.
|
|
1328
|
-
* - For range queries by score, use {@link RangeByScore}.
|
|
1329
|
-
* @param reverse - If `true`, reverses the sorted set, with index `0` as the element with the highest score.
|
|
1330
|
-
*
|
|
1331
|
-
* Command Response - The number of elements in the resulting sorted set.
|
|
1332
|
-
*/
|
|
1333
|
-
zrangeStore(destination: GlideString, source: GlideString, rangeQuery: RangeByScore | RangeByLex | RangeByIndex, reverse?: boolean): T;
|
|
1334
|
-
/**
|
|
1335
|
-
* Computes the intersection of sorted sets given by the specified `keys` and stores the result in `destination`.
|
|
1336
|
-
* If `destination` already exists, it is overwritten. Otherwise, a new sorted set will be created.
|
|
1337
|
-
*
|
|
1338
|
-
* @see {@link https://valkey.io/commands/zinterstore/|valkey.io} for details.
|
|
1339
|
-
*
|
|
1340
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1341
|
-
*
|
|
1342
|
-
* @param destination - The key of the destination sorted set.
|
|
1343
|
-
* @param keys - The keys of the sorted sets with possible formats:
|
|
1344
|
-
* - `GlideString[]` - for keys only.
|
|
1345
|
-
* - `KeyWeight[]` - for weighted keys with score multipliers.
|
|
1346
|
-
* @param options - (Optional) Additional parameters:
|
|
1347
|
-
* - (Optional) `aggregationType`: the aggregation strategy to apply when combining the scores of elements. See {@link AggregationType}.
|
|
1348
|
-
* If `aggregationType` is not specified, defaults to `AggregationType.SUM`.
|
|
1349
|
-
*
|
|
1350
|
-
* Command Response - The number of elements in the resulting sorted set stored at `destination`.
|
|
1351
|
-
*/
|
|
1352
|
-
zinterstore(destination: GlideString, keys: GlideString[] | KeyWeight[], options?: {
|
|
1353
|
-
aggregationType?: AggregationType;
|
|
1354
|
-
}): T;
|
|
1355
|
-
/**
|
|
1356
|
-
* Computes the intersection of sorted sets given by the specified `keys` and returns a list of intersecting elements.
|
|
1357
|
-
* To get the scores as well, see {@link zinterWithScores}.
|
|
1358
|
-
* To store the result in a key as a sorted set, see {@link zinterStore}.
|
|
1359
|
-
*
|
|
1360
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1361
|
-
*
|
|
1362
|
-
* @see {@link https://valkey.io/commands/zinter/|valkey.io} for details.
|
|
1363
|
-
*
|
|
1364
|
-
* @param keys - The keys of the sorted sets.
|
|
1365
|
-
*
|
|
1366
|
-
* Command Response - The resulting array of intersecting elements.
|
|
1367
|
-
*/
|
|
1368
|
-
zinter(keys: GlideString[]): T;
|
|
1369
|
-
/**
|
|
1370
|
-
* Computes the intersection of sorted sets given by the specified `keys` and returns a list of intersecting elements with scores.
|
|
1371
|
-
* To get the elements only, see {@link zinter}.
|
|
1372
|
-
* To store the result in a key as a sorted set, see {@link zinterStore}.
|
|
1373
|
-
*
|
|
1374
|
-
* @see {@link https://valkey.io/commands/zinter/|valkey.io} for details.
|
|
1375
|
-
*
|
|
1376
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1377
|
-
*
|
|
1378
|
-
* @param keys - The keys of the sorted sets with possible formats:
|
|
1379
|
-
* - `GlideString[]` - for keys only.
|
|
1380
|
-
* - `KeyWeight[]` - for weighted keys with score multipliers.
|
|
1381
|
-
* @param options - (Optional) Additional parameters:
|
|
1382
|
-
* - (Optional) `aggregationType`: the aggregation strategy to apply when combining the scores of elements. See {@link AggregationType}.
|
|
1383
|
-
* If `aggregationType` is not specified, defaults to `AggregationType.SUM`.
|
|
1384
|
-
*
|
|
1385
|
-
* Command Response - A list of elements and their scores representing the intersection of the sorted sets.
|
|
1386
|
-
* If a key does not exist, it is treated as an empty sorted set, and the command returns an empty result.
|
|
1387
|
-
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1388
|
-
*/
|
|
1389
|
-
zinterWithScores(keys: GlideString[] | KeyWeight[], options?: {
|
|
1390
|
-
aggregationType?: AggregationType;
|
|
1391
|
-
}): T;
|
|
1392
|
-
/**
|
|
1393
|
-
* Computes the union of sorted sets given by the specified `keys` and returns a list of union elements.
|
|
1394
|
-
*
|
|
1395
|
-
* To get the scores as well, see {@link zunionWithScores}.
|
|
1396
|
-
* To store the result in a key as a sorted set, see {@link zunionstore}.
|
|
1397
|
-
*
|
|
1398
|
-
* @see {@link https://valkey.io/commands/zunion/|valkey.io} for details.
|
|
1399
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1400
|
-
*
|
|
1401
|
-
* @param keys - The keys of the sorted sets.
|
|
1402
|
-
*
|
|
1403
|
-
* Command Response - The resulting array with a union of sorted set elements.
|
|
1404
|
-
*/
|
|
1405
|
-
zunion(keys: GlideString[]): T;
|
|
1406
|
-
/**
|
|
1407
|
-
* Computes the intersection of sorted sets given by the specified `keys` and returns a list of union elements with scores.
|
|
1408
|
-
* To get the elements only, see {@link zunion}.
|
|
1409
|
-
*
|
|
1410
|
-
* @see {@link https://valkey.io/commands/zunion/|valkey.io} for details.
|
|
1411
|
-
*
|
|
1412
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1413
|
-
*
|
|
1414
|
-
* @param keys - The keys of the sorted sets with possible formats:
|
|
1415
|
-
* - `GlideString[]` - for keys only.
|
|
1416
|
-
* - `KeyWeight[]` - for weighted keys with their score multipliers.
|
|
1417
|
-
* @param options - (Optional) Additional parameters:
|
|
1418
|
-
* - (Optional) `aggregationType`: the aggregation strategy to apply when combining the scores of elements. See {@link AggregationType}.
|
|
1419
|
-
* If `aggregationType` is not specified, defaults to `AggregationType.SUM`.
|
|
1420
|
-
*
|
|
1421
|
-
* Command Response - A list of elements and their scores representing the intersection of the sorted sets.
|
|
1422
|
-
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1423
|
-
*/
|
|
1424
|
-
zunionWithScores(keys: GlideString[] | KeyWeight[], options?: {
|
|
1425
|
-
aggregationType?: AggregationType;
|
|
1426
|
-
}): T;
|
|
1427
|
-
/**
|
|
1428
|
-
* Returns a random member from the sorted set stored at `key`.
|
|
1429
|
-
*
|
|
1430
|
-
* @see {@link https://valkey.io/commands/zrandmember/|valkey.io} for details.
|
|
1431
|
-
*
|
|
1432
|
-
* @param keys - The key of the sorted set.
|
|
1433
|
-
*
|
|
1434
|
-
* Command Response - A string representing a random member from the sorted set.
|
|
1435
|
-
* If the sorted set does not exist or is empty, the response will be `null`.
|
|
1436
|
-
*/
|
|
1437
|
-
zrandmember(key: GlideString): T;
|
|
1438
|
-
/**
|
|
1439
|
-
* Returns random members from the sorted set stored at `key`.
|
|
1440
|
-
*
|
|
1441
|
-
* @see {@link https://valkey.io/commands/zrandmember/|valkey.io} for details.
|
|
1442
|
-
*
|
|
1443
|
-
* @param keys - The key of the sorted set.
|
|
1444
|
-
* @param count - The number of members to return.
|
|
1445
|
-
* If `count` is positive, returns unique members.
|
|
1446
|
-
* If negative, allows for duplicates.
|
|
1447
|
-
*
|
|
1448
|
-
* Command Response - An `array` of members from the sorted set.
|
|
1449
|
-
* If the sorted set does not exist or is empty, the response will be an empty `array`.
|
|
1450
|
-
*/
|
|
1451
|
-
zrandmemberWithCount(key: GlideString, count: number): T;
|
|
1452
|
-
/**
|
|
1453
|
-
* Returns random members with scores from the sorted set stored at `key`.
|
|
1454
|
-
*
|
|
1455
|
-
* @see {@link https://valkey.io/commands/zrandmember/|valkey.io} for details.
|
|
1456
|
-
*
|
|
1457
|
-
* @param keys - The key of the sorted set.
|
|
1458
|
-
* @param count - The number of members to return.
|
|
1459
|
-
* If `count` is positive, returns unique members.
|
|
1460
|
-
* If negative, allows for duplicates.
|
|
1461
|
-
*
|
|
1462
|
-
* Command Response - A list of {@link KeyWeight} tuples, which store member names and their respective scores.
|
|
1463
|
-
* If the sorted set does not exist or is empty, the response will be an empty `array`.
|
|
1464
|
-
*/
|
|
1465
|
-
zrandmemberWithCountWithScores(key: GlideString, count: number): T;
|
|
1466
|
-
/**
|
|
1467
|
-
* Returns the string representation of the type of the value stored at `key`.
|
|
1468
|
-
*
|
|
1469
|
-
* @see {@link https://valkey.io/commands/type/|valkey.io} for details.
|
|
1470
|
-
*
|
|
1471
|
-
* @param key - The key to check its data type.
|
|
1472
|
-
*
|
|
1473
|
-
* Command Response - If the key exists, the type of the stored value is returned. Otherwise, a "none" string is returned.
|
|
1474
|
-
*/
|
|
1475
|
-
type(key: GlideString): T;
|
|
1476
|
-
/**
|
|
1477
|
-
* Returns the length of the string value stored at `key`.
|
|
1478
|
-
*
|
|
1479
|
-
* @see {@link https://valkey.io/commands/strlen/|valkey.io} for details.
|
|
1480
|
-
*
|
|
1481
|
-
* @param key - The `key` to check its length.
|
|
1482
|
-
*
|
|
1483
|
-
* Command Response - The length of the string value stored at `key`
|
|
1484
|
-
* If `key` does not exist, it is treated as an empty string, and the command returns `0`.
|
|
1485
|
-
*/
|
|
1486
|
-
strlen(key: GlideString): T;
|
|
1487
|
-
/**
|
|
1488
|
-
* Removes and returns the members with the lowest scores from the sorted set stored at `key`.
|
|
1489
|
-
* If `count` is provided, up to `count` members with the lowest scores are removed and returned.
|
|
1490
|
-
* Otherwise, only one member with the lowest score is removed and returned.
|
|
1491
|
-
*
|
|
1492
|
-
* @see {@link https://valkey.io/commands/zpopmin/|valkey.io} for more details.
|
|
1493
|
-
*
|
|
1494
|
-
* @param key - The key of the sorted set.
|
|
1495
|
-
* @param count - Specifies the quantity of members to pop. If not specified, pops one member.
|
|
1496
|
-
*
|
|
1497
|
-
* Command Response - A list of the removed members and their scores, ordered from the one with the lowest score to the one with the highest.
|
|
1498
|
-
* If `key` doesn't exist, it will be treated as an empty sorted set and the command returns an empty map.
|
|
1499
|
-
* If `count` is higher than the sorted set's cardinality, returns all members and their scores.
|
|
1500
|
-
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1501
|
-
*/
|
|
1502
|
-
zpopmin(key: GlideString, count?: number): T;
|
|
1503
|
-
/**
|
|
1504
|
-
* Blocks the connection until it removes and returns a member with the lowest score from the
|
|
1505
|
-
* first non-empty sorted set, with the given `key` being checked in the order they
|
|
1506
|
-
* are provided.
|
|
1507
|
-
* `BZPOPMIN` is the blocking variant of {@link zpopmin}.
|
|
1508
|
-
*
|
|
1509
|
-
* @see {@link https://valkey.io/commands/bzpopmin/|valkey.io} for details.
|
|
1510
|
-
*
|
|
1511
|
-
* @param keys - The keys of the sorted sets.
|
|
1512
|
-
* @param timeout - The number of seconds to wait for a blocking operation to complete. A value of
|
|
1513
|
-
* `0` will block indefinitely. Since Valkey version 6.0.0: timeout is interpreted as a double instead of an integer.
|
|
1514
|
-
*
|
|
1515
|
-
* Command Response - An `array` containing the key where the member was popped out, the member, itself, and the member score.
|
|
1516
|
-
* If no member could be popped and the `timeout` expired, returns `null`.
|
|
1517
|
-
*/
|
|
1518
|
-
bzpopmin(keys: GlideString[], timeout: number): T;
|
|
1519
|
-
/**
|
|
1520
|
-
* Removes and returns the members with the highest scores from the sorted set stored at `key`.
|
|
1521
|
-
* If `count` is provided, up to `count` members with the highest scores are removed and returned.
|
|
1522
|
-
* Otherwise, only one member with the highest score is removed and returned.
|
|
1523
|
-
*
|
|
1524
|
-
* @see {@link https://valkey.io/commands/zpopmax/|valkey.io} for more details.
|
|
1525
|
-
*
|
|
1526
|
-
* @param key - The key of the sorted set.
|
|
1527
|
-
* @param count - Specifies the quantity of members to pop. If not specified, pops one member.
|
|
1528
|
-
*
|
|
1529
|
-
* Command Response - A list of the removed members and their scores, ordered from the one with the lowest score to the one with the highest.
|
|
1530
|
-
* If `key` doesn't exist, it will be treated as an empty sorted set and the command returns an empty map.
|
|
1531
|
-
* If `count` is higher than the sorted set's cardinality, returns all members and their scores.
|
|
1532
|
-
* The response comes in format `GlideRecord<number>`, see {@link GlideRecord}.
|
|
1533
|
-
*/
|
|
1534
|
-
zpopmax(key: GlideString, count?: number): T;
|
|
1535
|
-
/**
|
|
1536
|
-
* Blocks the connection until it removes and returns a member with the highest score from the
|
|
1537
|
-
* first non-empty sorted set, with the given `key` being checked in the order they
|
|
1538
|
-
* are provided.
|
|
1539
|
-
* `BZPOPMAX` is the blocking variant of {@link zpopmax}.
|
|
1540
|
-
*
|
|
1541
|
-
* @see {@link https://valkey.io/commands/bzpopmax/|valkey.io} for details.
|
|
1542
|
-
*
|
|
1543
|
-
* @param keys - The keys of the sorted sets.
|
|
1544
|
-
* @param timeout - The number of seconds to wait for a blocking operation to complete. A value of
|
|
1545
|
-
* `0` will block indefinitely. Since 6.0.0: timeout is interpreted as a double instead of an integer.
|
|
1546
|
-
*
|
|
1547
|
-
* Command Response - An `array` containing the key where the member was popped out, the member, itself, and the member score.
|
|
1548
|
-
* If no member could be popped and the `timeout` expired, returns `null`.
|
|
1549
|
-
*/
|
|
1550
|
-
bzpopmax(keys: GlideString[], timeout: number): T;
|
|
1551
|
-
/**
|
|
1552
|
-
* Echoes the provided `message` back
|
|
1553
|
-
*
|
|
1554
|
-
* @see {@link https://valkey.io/commands/echo/|valkey.io} for more details.
|
|
1555
|
-
*
|
|
1556
|
-
* @param message - The message to be echoed back.
|
|
1557
|
-
*
|
|
1558
|
-
* Command Response - The provided `message`.
|
|
1559
|
-
*/
|
|
1560
|
-
echo(message: GlideString): T;
|
|
1561
|
-
/**
|
|
1562
|
-
* Returns the remaining time to live of `key` that has a timeout, in milliseconds.
|
|
1563
|
-
*
|
|
1564
|
-
* @see {@link https://valkey.io/commands/pttl/|valkey.io} for more details.
|
|
1565
|
-
*
|
|
1566
|
-
* @param key - The key to return its timeout.
|
|
1567
|
-
*
|
|
1568
|
-
* Command Response - TTL in milliseconds, `-2` if `key` does not exist, `-1` if `key` exists but has no associated expire.
|
|
1569
|
-
*/
|
|
1570
|
-
pttl(key: GlideString): T;
|
|
1571
|
-
/**
|
|
1572
|
-
* Removes all elements in the sorted set stored at `key` with rank between `start` and `end`.
|
|
1573
|
-
* Both `start` and `end` are zero-based indexes with 0 being the element with the lowest score.
|
|
1574
|
-
* These indexes can be negative numbers, where they indicate offsets starting at the element with the highest score.
|
|
1575
|
-
*
|
|
1576
|
-
* @see {@link https://valkey.io/commands/zremrangebyrank/|valkey.io} for details.
|
|
1577
|
-
*
|
|
1578
|
-
* @param key - The key of the sorted set.
|
|
1579
|
-
* @param start - The starting point of the range.
|
|
1580
|
-
* @param end - The end of the range.
|
|
1581
|
-
*
|
|
1582
|
-
* Command Response - The number of members removed.
|
|
1583
|
-
* If `start` exceeds the end of the sorted set, or if `start` is greater than `end`, 0 returned.
|
|
1584
|
-
* If `end` exceeds the actual end of the sorted set, the range will stop at the actual end of the sorted set.
|
|
1585
|
-
* If `key` does not exist 0 will be returned.
|
|
1586
|
-
*/
|
|
1587
|
-
zremRangeByRank(key: GlideString, start: number, end: number): T;
|
|
1588
|
-
/**
|
|
1589
|
-
* Removes all elements in the sorted set stored at `key` with lexicographical order between `minLex` and `maxLex`.
|
|
1590
|
-
*
|
|
1591
|
-
* @see {@link https://valkey.io/commands/zremrangebylex/|valkey.io} for details.
|
|
1592
|
-
*
|
|
1593
|
-
* @param key - The key of the sorted set.
|
|
1594
|
-
* @param minLex - The minimum lex to count from. Can be negative infinity, or a specific lex and inclusivity.
|
|
1595
|
-
* @param maxLex - The maximum lex to count up to. Can be positive infinity, or a specific lex and inclusivity.
|
|
1596
|
-
*
|
|
1597
|
-
* Command Response - The number of members removed.
|
|
1598
|
-
* If `key` does not exist, it is treated as an empty sorted set, and the command returns 0.
|
|
1599
|
-
* If `minLex` is greater than `maxLex`, 0 is returned.
|
|
1600
|
-
*/
|
|
1601
|
-
zremRangeByLex(key: GlideString, minLex: Boundary<GlideString>, maxLex: Boundary<GlideString>): T;
|
|
1602
|
-
/**
|
|
1603
|
-
* Removes all elements in the sorted set stored at `key` with a score between `minScore` and `maxScore`.
|
|
1604
|
-
*
|
|
1605
|
-
* @see {@link https://valkey.io/commands/zremrangebyscore/|valkey.io} for details.
|
|
1606
|
-
*
|
|
1607
|
-
* @param key - The key of the sorted set.
|
|
1608
|
-
* @param minScore - The minimum score to remove from. Can be negative infinity, or specific score and inclusivity.
|
|
1609
|
-
* @param maxScore - The maximum score to remove to. Can be positive infinity, or specific score and inclusivity.
|
|
1610
|
-
*
|
|
1611
|
-
* Command Response - the number of members removed.
|
|
1612
|
-
* If `key` does not exist, it is treated as an empty sorted set, and the command returns 0.
|
|
1613
|
-
* If `minScore` is greater than `maxScore`, 0 is returned.
|
|
1614
|
-
*/
|
|
1615
|
-
zremRangeByScore(key: GlideString, minScore: Boundary<number>, maxScore: Boundary<number>): T;
|
|
1616
|
-
/**
|
|
1617
|
-
* Returns the number of members in the sorted set stored at 'key' with scores between 'minLex' and 'maxLex'.
|
|
1618
|
-
*
|
|
1619
|
-
* @see {@link https://valkey.io/commands/zlexcount/|valkey.io} for details.
|
|
1620
|
-
*
|
|
1621
|
-
* @param key - The key of the sorted set.
|
|
1622
|
-
* @param minLex - The minimum lex to count from. Can be negative infinity, or a specific lex and inclusivity.
|
|
1623
|
-
* @param maxLex - The maximum lex to count up to. Can be positive infinity, or a specific lex and inclusivity.
|
|
1624
|
-
*
|
|
1625
|
-
* Command Response - The number of members in the specified lex range.
|
|
1626
|
-
* If 'key' does not exist, it is treated as an empty sorted set, and the command returns '0'.
|
|
1627
|
-
* If maxLex is less than minLex, '0' is returned.
|
|
1628
|
-
*/
|
|
1629
|
-
zlexcount(key: GlideString, minLex: Boundary<GlideString>, maxLex: Boundary<GlideString>): T;
|
|
1630
|
-
/**
|
|
1631
|
-
* Returns the rank of `member` in the sorted set stored at `key`, with scores ordered from low to high.
|
|
1632
|
-
* To get the rank of `member` with its score, see {@link zrankWithScore}.
|
|
1633
|
-
*
|
|
1634
|
-
* @see {@link https://valkey.io/commands/zrank/|valkey.io} for more details.
|
|
1635
|
-
*
|
|
1636
|
-
* @param key - The key of the sorted set.
|
|
1637
|
-
* @param member - The member whose rank is to be retrieved.
|
|
1638
|
-
*
|
|
1639
|
-
* Command Response - The rank of `member` in the sorted set.
|
|
1640
|
-
* If `key` doesn't exist, or if `member` is not present in the set, null will be returned.
|
|
1641
|
-
*/
|
|
1642
|
-
zrank(key: GlideString, member: GlideString): T;
|
|
1643
|
-
/**
|
|
1644
|
-
* Returns the rank of `member` in the sorted set stored at `key` with its score, where scores are ordered from the lowest to highest.
|
|
1645
|
-
*
|
|
1646
|
-
* @see {@link https://valkey.io/commands/zrank/|valkey.io} for more details.
|
|
1647
|
-
* @remarks Since Valkey version 7.2.0.
|
|
1648
|
-
*
|
|
1649
|
-
* @param key - The key of the sorted set.
|
|
1650
|
-
* @param member - The member whose rank is to be retrieved.
|
|
1651
|
-
*
|
|
1652
|
-
* Command Response - A list containing the rank and score of `member` in the sorted set.
|
|
1653
|
-
* If `key` doesn't exist, or if `member` is not present in the set, null will be returned.
|
|
1654
|
-
*/
|
|
1655
|
-
zrankWithScore(key: GlideString, member: GlideString): T;
|
|
1656
|
-
/**
|
|
1657
|
-
* Returns the rank of `member` in the sorted set stored at `key`, where
|
|
1658
|
-
* scores are ordered from the highest to lowest, starting from `0`.
|
|
1659
|
-
* To get the rank of `member` with its score, see {@link zrevrankWithScore}.
|
|
1660
|
-
*
|
|
1661
|
-
* @see {@link https://valkey.io/commands/zrevrank/|valkey.io} for details.
|
|
1662
|
-
*
|
|
1663
|
-
* @param key - The key of the sorted set.
|
|
1664
|
-
* @param member - The member whose rank is to be retrieved.
|
|
1665
|
-
*
|
|
1666
|
-
* Command Response - The rank of `member` in the sorted set, where ranks are ordered from high to low based on scores.
|
|
1667
|
-
* If `key` doesn't exist, or if `member` is not present in the set, `null` will be returned.
|
|
1668
|
-
*/
|
|
1669
|
-
zrevrank(key: GlideString, member: GlideString): T;
|
|
1670
|
-
/**
|
|
1671
|
-
* Returns the rank of `member` in the sorted set stored at `key` with its
|
|
1672
|
-
* score, where scores are ordered from the highest to lowest, starting from `0`.
|
|
1673
|
-
*
|
|
1674
|
-
* @see {@link https://valkey.io/commands/zrevrank/|valkey.io} for details.
|
|
1675
|
-
* @remarks Since Valkey version 7.2.0.
|
|
1676
|
-
*
|
|
1677
|
-
* @param key - The key of the sorted set.
|
|
1678
|
-
* @param member - The member whose rank is to be retrieved.
|
|
1679
|
-
*
|
|
1680
|
-
* Command Response - A list containing the rank and score of `member` in the sorted set, where ranks
|
|
1681
|
-
* are ordered from high to low based on scores.
|
|
1682
|
-
* If `key` doesn't exist, or if `member` is not present in the set, `null` will be returned.
|
|
1683
|
-
*/
|
|
1684
|
-
zrevrankWithScore(key: GlideString, member: GlideString): T;
|
|
1685
|
-
/**
|
|
1686
|
-
* Removes the existing timeout on `key`, turning the key from volatile (a key with an expire set) to
|
|
1687
|
-
* persistent (a key that will never expire as no timeout is associated).
|
|
1688
|
-
*
|
|
1689
|
-
* @see {@link https://valkey.io/commands/persist/|valkey.io} for details.
|
|
1690
|
-
*
|
|
1691
|
-
* @param key - The key to remove the existing timeout on.
|
|
1692
|
-
*
|
|
1693
|
-
* Command Response - `false` if `key` does not exist or does not have an associated timeout, `true` if the timeout has been removed.
|
|
1694
|
-
*/
|
|
1695
|
-
persist(key: GlideString): T;
|
|
1696
|
-
/** Executes a single command, without checking inputs. Every part of the command, including subcommands,
|
|
1697
|
-
* should be added as a separate value in args.
|
|
1698
|
-
*
|
|
1699
|
-
* @see {@link https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#custom-command|Valkey Glide Wiki} for details on the restrictions and limitations of the custom command API.
|
|
1700
|
-
*
|
|
1701
|
-
* Command Response - A response from Valkey with an `Object`.
|
|
1702
|
-
*/
|
|
1703
|
-
customCommand(args: GlideString[]): T;
|
|
1704
|
-
/** Returns the element at index `index` in the list stored at `key`.
|
|
1705
|
-
* The index is zero-based, so 0 means the first element, 1 the second element and so on.
|
|
1706
|
-
* Negative indices can be used to designate elements starting at the tail of the list.
|
|
1707
|
-
* Here, -1 means the last element, -2 means the penultimate and so forth.
|
|
1708
|
-
* @see {@link https://valkey.io/commands/lindex/|valkey.io} for details.
|
|
1709
|
-
*
|
|
1710
|
-
* @param key - The `key` of the list.
|
|
1711
|
-
* @param index - The `index` of the element in the list to retrieve.
|
|
1712
|
-
* Command Response - The element at index in the list stored at `key`.
|
|
1713
|
-
* If `index` is out of range or if `key` does not exist, null is returned.
|
|
1714
|
-
*/
|
|
1715
|
-
lindex(key: GlideString, index: number): T;
|
|
1716
|
-
/**
|
|
1717
|
-
* Inserts `element` in the list at `key` either before or after the `pivot`.
|
|
1718
|
-
*
|
|
1719
|
-
* @see {@link https://valkey.io/commands/linsert/|valkey.io} for details.
|
|
1720
|
-
*
|
|
1721
|
-
* @param key - The key of the list.
|
|
1722
|
-
* @param position - The relative position to insert into - either `InsertPosition.Before` or
|
|
1723
|
-
* `InsertPosition.After` the `pivot`.
|
|
1724
|
-
* @param pivot - An element of the list.
|
|
1725
|
-
* @param element - The new element to insert.
|
|
1726
|
-
*
|
|
1727
|
-
* Command Response - The list length after a successful insert operation.
|
|
1728
|
-
* If the `key` doesn't exist returns `-1`.
|
|
1729
|
-
* If the `pivot` wasn't found, returns `0`.
|
|
1730
|
-
*/
|
|
1731
|
-
linsert(key: GlideString, position: InsertPosition, pivot: GlideString, element: GlideString): T;
|
|
1732
|
-
/**
|
|
1733
|
-
* Adds an entry to the specified stream stored at `key`. If the `key` doesn't exist, the stream is created.
|
|
1734
|
-
* @see {@link https://valkey.io/commands/xadd/|valkey.io} for details.
|
|
1735
|
-
*
|
|
1736
|
-
* @param key - The key of the stream.
|
|
1737
|
-
* @param values - field-value pairs to be added to the entry.
|
|
1738
|
-
* @param options - (Optional) Stream add options.
|
|
1739
|
-
*
|
|
1740
|
-
* Command Response - The id of the added entry, or `null` if `options.makeStream` is set to `false` and no stream with the matching `key` exists.
|
|
1741
|
-
*/
|
|
1742
|
-
xadd(key: GlideString, values: [GlideString, GlideString][], options?: StreamAddOptions): T;
|
|
1743
|
-
/**
|
|
1744
|
-
* Removes the specified entries by id from a stream, and returns the number of entries deleted.
|
|
1745
|
-
*
|
|
1746
|
-
* @see {@link https://valkey.io/commands/xdel/|valkey.io} for more details.
|
|
1747
|
-
*
|
|
1748
|
-
* @param key - The key of the stream.
|
|
1749
|
-
* @param ids - An array of entry ids.
|
|
1750
|
-
*
|
|
1751
|
-
* Command Response - The number of entries removed from the stream. This number may be less than the number of entries in
|
|
1752
|
-
* `ids`, if the specified `ids` don't exist in the stream.
|
|
1753
|
-
*/
|
|
1754
|
-
xdel(key: GlideString, ids: string[]): T;
|
|
1755
|
-
/**
|
|
1756
|
-
* Trims the stream stored at `key` by evicting older entries.
|
|
1757
|
-
* @see {@link https://valkey.io/commands/xtrim/|valkey.io} for details.
|
|
1758
|
-
*
|
|
1759
|
-
* @param key - the key of the stream
|
|
1760
|
-
* @param options - options detailing how to trim the stream.
|
|
1761
|
-
*
|
|
1762
|
-
* Command Response - The number of entries deleted from the stream. If `key` doesn't exist, 0 is returned.
|
|
1763
|
-
*/
|
|
1764
|
-
xtrim(key: GlideString, options: StreamTrimOptions): T;
|
|
1765
|
-
/**
|
|
1766
|
-
* Returns information about the stream stored at `key`.
|
|
1767
|
-
*
|
|
1768
|
-
* @param key - The key of the stream.
|
|
1769
|
-
* @param fullOptions - If `true`, returns verbose information with a limit of the first 10 PEL entries.
|
|
1770
|
-
* If `number` is specified, returns verbose information limiting the returned PEL entries.
|
|
1771
|
-
* If `0` is specified, returns verbose information with no limit.
|
|
1772
|
-
*
|
|
1773
|
-
* Command Response - Detailed stream information for the given `key`.
|
|
1774
|
-
* See example of {@link BaseClient.xinfoStream} for more details.
|
|
1775
|
-
* The response comes in format `GlideRecord<StreamEntries | GlideRecord<StreamEntries | GlideRecord<StreamEntries>[]>[]>`, see {@link GlideRecord}.
|
|
1776
|
-
*/
|
|
1777
|
-
xinfoStream(key: GlideString, fullOptions?: boolean | number): T;
|
|
1778
|
-
/**
|
|
1779
|
-
* Returns the list of all consumer groups and their attributes for the stream stored at `key`.
|
|
1780
|
-
*
|
|
1781
|
-
* @see {@link https://valkey.io/commands/xinfo-groups/|valkey.io} for details.
|
|
1782
|
-
*
|
|
1783
|
-
* @param key - The key of the stream.
|
|
1784
|
-
*
|
|
1785
|
-
* Command Response - An `Array` of `Records`, where each mapping represents the
|
|
1786
|
-
* attributes of a consumer group for the stream at `key`.
|
|
1787
|
-
* The response comes in format `GlideRecord<GlideString | number | null>[]`, see {@link GlideRecord}.
|
|
1788
|
-
*/
|
|
1789
|
-
xinfoGroups(key: GlideString): T;
|
|
1790
|
-
/**
|
|
1791
|
-
* Returns the server time.
|
|
1792
|
-
*
|
|
1793
|
-
* @see {@link https://valkey.io/commands/time/|valkey.io} for details.
|
|
1794
|
-
*
|
|
1795
|
-
* Command Response - The current server time as an `array` with two items:
|
|
1796
|
-
* - A Unix timestamp,
|
|
1797
|
-
* - The amount of microseconds already elapsed in the current second.
|
|
1798
|
-
*/
|
|
1799
|
-
time(): T;
|
|
1800
|
-
/**
|
|
1801
|
-
* Returns stream entries matching a given range of entry IDs.
|
|
1802
|
-
*
|
|
1803
|
-
* @see {@link https://valkey.io/commands/xrange/|valkey.io} for more details.
|
|
1804
|
-
*
|
|
1805
|
-
* @param key - The key of the stream.
|
|
1806
|
-
* @param start - The starting stream entry ID bound for the range.
|
|
1807
|
-
* - Use `value` to specify a stream entry ID.
|
|
1808
|
-
* - Use `isInclusive: false` to specify an exclusive bounded stream entry ID. This is only available starting with Valkey version 6.2.0.
|
|
1809
|
-
* - Use `InfBoundary.NegativeInfinity` to start with the minimum available ID.
|
|
1810
|
-
* @param end - The ending stream ID bound for the range.
|
|
1811
|
-
* - Use `value` to specify a stream entry ID.
|
|
1812
|
-
* - Use `isInclusive: false` to specify an exclusive bounded stream entry ID. This is only available starting with Valkey version 6.2.0.
|
|
1813
|
-
* - Use `InfBoundary.PositiveInfinity` to end with the maximum available ID.
|
|
1814
|
-
* @param count - An optional argument specifying the maximum count of stream entries to return.
|
|
1815
|
-
* If `count` is not provided, all stream entries in the range will be returned.
|
|
1816
|
-
*
|
|
1817
|
-
* Command Response - A list of stream entry ids, to an array of entries, or `null` if `count` is non-positive.
|
|
1818
|
-
* The response comes in format `GlideRecord<[GlideString, GlideString][]> | null`, see {@link GlideRecord}.
|
|
1819
|
-
*/
|
|
1820
|
-
xrange(key: GlideString, start: Boundary<string>, end: Boundary<string>, count?: number): T;
|
|
1821
|
-
/**
|
|
1822
|
-
* Returns stream entries matching a given range of entry IDs in reverse order. Equivalent to {@link xrange} but returns the
|
|
1823
|
-
* entries in reverse order.
|
|
1824
|
-
*
|
|
1825
|
-
* @see {@link https://valkey.io/commands/xrevrange/|valkey.io} for more details.
|
|
1826
|
-
*
|
|
1827
|
-
* @param key - The key of the stream.
|
|
1828
|
-
* @param end - The ending stream entry ID bound for the range.
|
|
1829
|
-
* - Use `value` to specify a stream entry ID.
|
|
1830
|
-
* - Use `isInclusive: false` to specify an exclusive bounded stream entry ID. This is only available starting with Valkey version 6.2.0.
|
|
1831
|
-
* - Use `InfBoundary.PositiveInfinity` to end with the maximum available ID.
|
|
1832
|
-
* @param start - The ending stream ID bound for the range.
|
|
1833
|
-
* - Use `value` to specify a stream entry ID.
|
|
1834
|
-
* - Use `isInclusive: false` to specify an exclusive bounded stream entry ID. This is only available starting with Valkey version 6.2.0.
|
|
1835
|
-
* - Use `InfBoundary.NegativeInfinity` to start with the minimum available ID.
|
|
1836
|
-
* @param count - An optional argument specifying the maximum count of stream entries to return.
|
|
1837
|
-
* If `count` is not provided, all stream entries in the range will be returned.
|
|
1838
|
-
*
|
|
1839
|
-
* Command Response - A list of stream entry ids, to an array of entries, or `null` if `count` is non-positive.
|
|
1840
|
-
* The response comes in format `GlideRecord<[GlideString, GlideString][]> | null`, see {@link GlideRecord}.
|
|
1841
|
-
*/
|
|
1842
|
-
xrevrange(key: GlideString, end: Boundary<string>, start: Boundary<string>, count?: number): T;
|
|
1843
|
-
/**
|
|
1844
|
-
* Reads entries from the given streams.
|
|
1845
|
-
*
|
|
1846
|
-
* @see {@link https://valkey.io/commands/xread/|valkey.io} for details.
|
|
1847
|
-
*
|
|
1848
|
-
* @param keys_and_ids - An object of stream keys and entry IDs to read from.
|
|
1849
|
-
* @param options - (Optional) Parameters detailing how to read the stream - see {@link StreamReadOptions}.
|
|
1850
|
-
*
|
|
1851
|
-
* Command Response - A list of stream keys with a `Record` of stream IDs mapped to an `Array` of entries or `null` if key does not exist.
|
|
1852
|
-
* The response comes in format `GlideRecord<GlideRecord<[GlideString, GlideString][]>>`, see {@link GlideRecord}.
|
|
1853
|
-
*/
|
|
1854
|
-
xread(keys_and_ids: Record<string, string> | GlideRecord<string>, options?: StreamReadOptions): T;
|
|
1855
|
-
/**
|
|
1856
|
-
* Reads entries from the given streams owned by a consumer group.
|
|
1857
|
-
*
|
|
1858
|
-
* @see {@link https://valkey.io/commands/xreadgroup/|valkey.io} for details.
|
|
1859
|
-
*
|
|
1860
|
-
* @param group - The consumer group name.
|
|
1861
|
-
* @param consumer - The group consumer.
|
|
1862
|
-
* @param keys_and_ids - An object of stream keys and entry IDs to read from.
|
|
1863
|
-
* Use the special ID of `">"` to receive only new messages.
|
|
1864
|
-
* @param options - (Optional) Parameters detailing how to read the stream - see {@link StreamReadGroupOptions}.
|
|
1865
|
-
*
|
|
1866
|
-
* Command Response - A list of stream keys with a `Record` of stream IDs mapped to an `Array` of entries.
|
|
1867
|
-
* Returns `null` if there is no stream that can be served.
|
|
1868
|
-
* The response comes in format `GlideRecord<GlideRecord<[GlideString, GlideString][]>>`, see {@link GlideRecord}.
|
|
1869
|
-
*/
|
|
1870
|
-
xreadgroup(group: GlideString, consumer: GlideString, keys_and_ids: Record<string, string> | GlideRecord<string>, options?: StreamReadGroupOptions): T;
|
|
1871
|
-
/**
|
|
1872
|
-
* Returns the number of entries in the stream stored at `key`.
|
|
1873
|
-
*
|
|
1874
|
-
* @see {@link https://valkey.io/commands/xlen/|valkey.io} for details.
|
|
1875
|
-
*
|
|
1876
|
-
* @param key - The key of the stream.
|
|
1877
|
-
*
|
|
1878
|
-
* Command Response - The number of entries in the stream. If `key` does not exist, returns `0`.
|
|
1879
|
-
*/
|
|
1880
|
-
xlen(key: GlideString): T;
|
|
1881
|
-
/**
|
|
1882
|
-
* Returns stream message summary information for pending messages matching a given range of IDs.
|
|
1883
|
-
*
|
|
1884
|
-
* @see {@link https://valkey.io/commands/xpending/|valkey.io} for details.
|
|
1885
|
-
*
|
|
1886
|
-
* @param key - The key of the stream.
|
|
1887
|
-
* @param group - The consumer group name.
|
|
1888
|
-
*
|
|
1889
|
-
* Command Response - An `array` that includes the summary of the pending messages.
|
|
1890
|
-
* See example of {@link BaseClient.xpending|xpending} for more details.
|
|
1891
|
-
*/
|
|
1892
|
-
xpending(key: GlideString, group: GlideString): T;
|
|
1893
|
-
/**
|
|
1894
|
-
* Returns stream message summary information for pending messages matching a given range of IDs.
|
|
1895
|
-
*
|
|
1896
|
-
* @see {@link https://valkey.io/commands/xpending/|valkey.io} for details.
|
|
1897
|
-
*
|
|
1898
|
-
* @param key - The key of the stream.
|
|
1899
|
-
* @param group - The consumer group name.
|
|
1900
|
-
* @param options - Additional options to filter entries, see {@link StreamPendingOptions}.
|
|
1901
|
-
*
|
|
1902
|
-
* Command Response - A 2D-`array` of 4-tuples containing extended message information.
|
|
1903
|
-
* See example of {@link BaseClient.xpendingWithOptions|xpendingWithOptions} for more details.
|
|
1904
|
-
*/
|
|
1905
|
-
xpendingWithOptions(key: GlideString, group: GlideString, options: StreamPendingOptions): T;
|
|
1906
|
-
/**
|
|
1907
|
-
* Returns the list of all consumers and their attributes for the given consumer group of the
|
|
1908
|
-
* stream stored at `key`.
|
|
1909
|
-
*
|
|
1910
|
-
* @see {@link https://valkey.io/commands/xinfo-consumers/|valkey.io} for details.
|
|
1911
|
-
*
|
|
1912
|
-
* Command Response - An `Array` of `Records`, where each mapping contains the attributes
|
|
1913
|
-
* of a consumer for the given consumer group of the stream at `key`.
|
|
1914
|
-
* The response comes in format `GlideRecord<GlideString | number>[]`, see {@link GlideRecord}.
|
|
1915
|
-
*/
|
|
1916
|
-
xinfoConsumers(key: GlideString, group: GlideString): T;
|
|
1917
|
-
/**
|
|
1918
|
-
* Changes the ownership of a pending message.
|
|
1919
|
-
*
|
|
1920
|
-
* @see {@link https://valkey.io/commands/xclaim/|valkey.io} for details.
|
|
1921
|
-
*
|
|
1922
|
-
* @param key - The key of the stream.
|
|
1923
|
-
* @param group - The consumer group name.
|
|
1924
|
-
* @param consumer - The group consumer.
|
|
1925
|
-
* @param minIdleTime - The minimum idle time for the message to be claimed.
|
|
1926
|
-
* @param ids - An array of entry ids.
|
|
1927
|
-
* @param options - (Optional) Stream claim options {@link StreamClaimOptions}.
|
|
1928
|
-
*
|
|
1929
|
-
* Command Response - Message entries that are claimed by the consumer.
|
|
1930
|
-
* The response comes in format `GlideRecord<[GlideString, GlideString][]>`, see {@link GlideRecord}.
|
|
1931
|
-
*/
|
|
1932
|
-
xclaim(key: GlideString, group: GlideString, consumer: GlideString, minIdleTime: number, ids: string[], options?: StreamClaimOptions): T;
|
|
1933
|
-
/**
|
|
1934
|
-
* Changes the ownership of a pending message. This function returns an `array` with
|
|
1935
|
-
* only the message/entry IDs, and is equivalent to using `JUSTID` in the Valkey API.
|
|
1936
|
-
*
|
|
1937
|
-
* @see {@link https://valkey.io/commands/xclaim/|valkey.io} for details.
|
|
1938
|
-
*
|
|
1939
|
-
* @param key - The key of the stream.
|
|
1940
|
-
* @param group - The consumer group name.
|
|
1941
|
-
* @param consumer - The group consumer.
|
|
1942
|
-
* @param minIdleTime - The minimum idle time for the message to be claimed.
|
|
1943
|
-
* @param ids - An array of entry ids.
|
|
1944
|
-
* @param options - (Optional) Stream claim options {@link StreamClaimOptions}.
|
|
1945
|
-
*
|
|
1946
|
-
* Command Response - An `array` of message ids claimed by the consumer.
|
|
1947
|
-
*/
|
|
1948
|
-
xclaimJustId(key: GlideString, group: GlideString, consumer: GlideString, minIdleTime: number, ids: string[], options?: StreamClaimOptions): T;
|
|
1949
|
-
/**
|
|
1950
|
-
* Transfers ownership of pending stream entries that match the specified criteria.
|
|
1951
|
-
*
|
|
1952
|
-
* @see {@link https://valkey.io/commands/xautoclaim/|valkey.io} for more details.
|
|
1953
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1954
|
-
*
|
|
1955
|
-
* @param key - The key of the stream.
|
|
1956
|
-
* @param group - The consumer group name.
|
|
1957
|
-
* @param consumer - The group consumer.
|
|
1958
|
-
* @param minIdleTime - The minimum idle time for the message to be claimed.
|
|
1959
|
-
* @param start - Filters the claimed entries to those that have an ID equal or greater than the
|
|
1960
|
-
* specified value.
|
|
1961
|
-
* @param options - (Optional) Additional parameters:
|
|
1962
|
-
* - (Optional) `count`: the number of claimed entries.
|
|
1963
|
-
*
|
|
1964
|
-
* Command Response - An `array` containing the following elements:
|
|
1965
|
-
* - A stream ID to be used as the start argument for the next call to `XAUTOCLAIM`. This ID is
|
|
1966
|
-
* equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if
|
|
1967
|
-
* the entire stream was scanned.
|
|
1968
|
-
* - A mapping of the claimed entries.
|
|
1969
|
-
* - If you are using Valkey 7.0.0 or above, the response list will also include a list containing
|
|
1970
|
-
* the message IDs that were in the Pending Entries List but no longer exist in the stream.
|
|
1971
|
-
* These IDs are deleted from the Pending Entries List.
|
|
1972
|
-
*
|
|
1973
|
-
* The response comes in format `[GlideString, GlideRecord<[GlideString, GlideString][]>, GlideString[]?]`, see {@link GlideRecord}.
|
|
1974
|
-
*/
|
|
1975
|
-
xautoclaim(key: GlideString, group: GlideString, consumer: GlideString, minIdleTime: number, start: string, options?: {
|
|
1976
|
-
count?: number;
|
|
1977
|
-
}): T;
|
|
1978
|
-
/**
|
|
1979
|
-
* Transfers ownership of pending stream entries that match the specified criteria.
|
|
1980
|
-
*
|
|
1981
|
-
* @see {@link https://valkey.io/commands/xautoclaim/|valkey.io} for more details.
|
|
1982
|
-
* @remarks Since Valkey version 6.2.0.
|
|
1983
|
-
*
|
|
1984
|
-
* @param key - The key of the stream.
|
|
1985
|
-
* @param group - The consumer group name.
|
|
1986
|
-
* @param consumer - The group consumer.
|
|
1987
|
-
* @param minIdleTime - The minimum idle time for the message to be claimed.
|
|
1988
|
-
* @param start - Filters the claimed entries to those that have an ID equal or greater than the
|
|
1989
|
-
* specified value.
|
|
1990
|
-
* @param options - (Optional) Additional parameters:
|
|
1991
|
-
* - (Optional) `count`: limits the number of claimed entries to the specified value.
|
|
1992
|
-
*
|
|
1993
|
-
* Command Response - An `array` containing the following elements:
|
|
1994
|
-
* - A stream ID to be used as the start argument for the next call to `XAUTOCLAIM`. This ID is
|
|
1995
|
-
* equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if
|
|
1996
|
-
* the entire stream was scanned.
|
|
1997
|
-
* - A list of the IDs for the claimed entries.
|
|
1998
|
-
* - If you are using Valkey 7.0.0 or above, the response list will also include a list containing
|
|
1999
|
-
* the message IDs that were in the Pending Entries List but no longer exist in the stream.
|
|
2000
|
-
* These IDs are deleted from the Pending Entries List.
|
|
2001
|
-
*/
|
|
2002
|
-
xautoclaimJustId(key: GlideString, group: GlideString, consumer: GlideString, minIdleTime: number, start: string, options?: {
|
|
2003
|
-
count?: number;
|
|
2004
|
-
}): T;
|
|
2005
|
-
/**
|
|
2006
|
-
* Creates a new consumer group uniquely identified by `groupname` for the stream
|
|
2007
|
-
* stored at `key`.
|
|
2008
|
-
*
|
|
2009
|
-
* @see {@link https://valkey.io/commands/xgroup-create/|valkey.io} for details.
|
|
2010
|
-
*
|
|
2011
|
-
* @param key - The key of the stream.
|
|
2012
|
-
* @param groupName - The newly created consumer group name.
|
|
2013
|
-
* @param id - Stream entry ID that specifies the last delivered entry in the stream from the new
|
|
2014
|
-
* group’s perspective. The special ID `"$"` can be used to specify the last entry in the stream.
|
|
2015
|
-
*
|
|
2016
|
-
* Command Response - `"OK"`.
|
|
2017
|
-
*/
|
|
2018
|
-
xgroupCreate(key: GlideString, groupName: GlideString, id: string, options?: StreamGroupOptions): T;
|
|
2019
|
-
/**
|
|
2020
|
-
* Destroys the consumer group `groupname` for the stream stored at `key`.
|
|
2021
|
-
*
|
|
2022
|
-
* @see {@link https://valkey.io/commands/xgroup-destroy/|valkey.io} for details.
|
|
2023
|
-
*
|
|
2024
|
-
* @param key - The key of the stream.
|
|
2025
|
-
* @param groupname - The newly created consumer group name.
|
|
2026
|
-
*
|
|
2027
|
-
* Command Response - `true` if the consumer group is destroyed. Otherwise, `false`.
|
|
2028
|
-
*/
|
|
2029
|
-
xgroupDestroy(key: GlideString, groupName: GlideString): T;
|
|
2030
|
-
/**
|
|
2031
|
-
* Creates a consumer named `consumerName` in the consumer group `groupName` for the stream stored at `key`.
|
|
2032
|
-
*
|
|
2033
|
-
* @see {@link https://valkey.io/commands/xgroup-createconsumer/|valkey.io} for more details.
|
|
2034
|
-
*
|
|
2035
|
-
* @param key - The key of the stream.
|
|
2036
|
-
* @param groupName - The consumer group name.
|
|
2037
|
-
* @param consumerName - The newly created consumer.
|
|
2038
|
-
*
|
|
2039
|
-
* Command Response - `true` if the consumer is created. Otherwise, returns `false`.
|
|
2040
|
-
*/
|
|
2041
|
-
xgroupCreateConsumer(key: GlideString, groupName: GlideString, consumerName: GlideString): T;
|
|
2042
|
-
/**
|
|
2043
|
-
* Deletes a consumer named `consumerName` in the consumer group `groupName` for the stream stored at `key`.
|
|
2044
|
-
*
|
|
2045
|
-
* @see {@link https://valkey.io/commands/xgroup-delconsumer/|valkey.io} for more details.
|
|
2046
|
-
*
|
|
2047
|
-
* @param key - The key of the stream.
|
|
2048
|
-
* @param groupName - The consumer group name.
|
|
2049
|
-
* @param consumerName - The consumer to delete.
|
|
2050
|
-
*
|
|
2051
|
-
* Command Response - The number of pending messages the `consumer` had before it was deleted.
|
|
2052
|
-
*/
|
|
2053
|
-
xgroupDelConsumer(key: GlideString, groupName: GlideString, consumerName: GlideString): T;
|
|
2054
|
-
/**
|
|
2055
|
-
* Returns the number of messages that were successfully acknowledged by the consumer group member of a stream.
|
|
2056
|
-
* This command should be called on a pending message so that such message does not get processed again.
|
|
2057
|
-
*
|
|
2058
|
-
* @see {@link https://valkey.io/commands/xack/|valkey.io} for details.
|
|
2059
|
-
*
|
|
2060
|
-
* @param key - The key of the stream.
|
|
2061
|
-
* @param group - The consumer group name.
|
|
2062
|
-
* @param ids - An array of entry ids.
|
|
2063
|
-
*
|
|
2064
|
-
* Command Response - The number of messages that were successfully acknowledged.
|
|
2065
|
-
*/
|
|
2066
|
-
xack(key: GlideString, group: GlideString, ids: string[]): T;
|
|
2067
|
-
/**
|
|
2068
|
-
* Sets the last delivered ID for a consumer group.
|
|
2069
|
-
*
|
|
2070
|
-
* @see {@link https://valkey.io/commands/xgroup-setid|valkey.io} for more details.
|
|
2071
|
-
*
|
|
2072
|
-
* @param key - The key of the stream.
|
|
2073
|
-
* @param groupName - The consumer group name.
|
|
2074
|
-
* @param id - The stream entry ID that should be set as the last delivered ID for the consumer group.
|
|
2075
|
-
* @param options - (Optional) Additional parameters:
|
|
2076
|
-
* - (Optional) `entriesRead`: the number of stream entries already read by the group.
|
|
2077
|
-
* This option can only be specified if you are using Valkey version 7.0.0 or above.
|
|
2078
|
-
*
|
|
2079
|
-
* Command Response - `"OK"`.
|
|
2080
|
-
*/
|
|
2081
|
-
xgroupSetId(key: GlideString, groupName: GlideString, id: string, options?: {
|
|
2082
|
-
entriesRead?: number;
|
|
2083
|
-
}): T;
|
|
2084
|
-
/**
|
|
2085
|
-
* Renames `key` to `newkey`.
|
|
2086
|
-
* If `newkey` already exists it is overwritten.
|
|
2087
|
-
*
|
|
2088
|
-
* @see {@link https://valkey.io/commands/rename/|valkey.io} for details.
|
|
2089
|
-
*
|
|
2090
|
-
* @param key - The key to rename.
|
|
2091
|
-
* @param newKey - The new name of the key.
|
|
2092
|
-
*
|
|
2093
|
-
* Command Response - If the `key` was successfully renamed, return "OK". If `key` does not exist, an error is thrown.
|
|
2094
|
-
*/
|
|
2095
|
-
rename(key: GlideString, newKey: GlideString): T;
|
|
2096
|
-
/**
|
|
2097
|
-
* Renames `key` to `newkey` if `newkey` does not yet exist.
|
|
2098
|
-
*
|
|
2099
|
-
* @see {@link https://valkey.io/commands/renamenx/|valkey.io} for details.
|
|
2100
|
-
*
|
|
2101
|
-
* @param key - The key to rename.
|
|
2102
|
-
* @param newKey - The new name of the key.
|
|
2103
|
-
*
|
|
2104
|
-
* Command Response - If the `key` was successfully renamed, returns `true`. Otherwise, returns `false`.
|
|
2105
|
-
* If `key` does not exist, an error is thrown.
|
|
2106
|
-
*/
|
|
2107
|
-
renamenx(key: GlideString, newKey: GlideString): T;
|
|
2108
|
-
/** Blocking list pop primitive.
|
|
2109
|
-
* Pop an element from the tail of the first list that is non-empty,
|
|
2110
|
-
* with the given `keys` being checked in the order that they are given.
|
|
2111
|
-
* Blocks the connection when there are no elements to pop from any of the given lists.
|
|
2112
|
-
*
|
|
2113
|
-
* @see {@link https://valkey.io/commands/brpop/|valkey.io} for details.
|
|
2114
|
-
* @remarks `BRPOP` is a blocking command, see [Blocking Commands](https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#blocking-commands) for more details and best practices.
|
|
2115
|
-
*
|
|
2116
|
-
* @param keys - The `keys` of the lists to pop from.
|
|
2117
|
-
* @param timeout - The `timeout` in seconds.
|
|
2118
|
-
*
|
|
2119
|
-
* Command Response - An `array` containing the `key` from which the element was popped and the value of the popped element,
|
|
2120
|
-
* formatted as [key, value]. If no element could be popped and the timeout expired, returns `null`.
|
|
2121
|
-
*/
|
|
2122
|
-
brpop(keys: GlideString[], timeout: number): T;
|
|
2123
|
-
/** Blocking list pop primitive.
|
|
2124
|
-
* Pop an element from the head of the first list that is non-empty,
|
|
2125
|
-
* with the given `keys` being checked in the order that they are given.
|
|
2126
|
-
* Blocks the connection when there are no elements to pop from any of the given lists.
|
|
2127
|
-
*
|
|
2128
|
-
* @see {@link https://valkey.io/commands/blpop/|valkey.io} for details.
|
|
2129
|
-
* @remarks `BLPOP` is a blocking command, see [Blocking Commands](https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#blocking-commands) for more details and best practices.
|
|
2130
|
-
*
|
|
2131
|
-
* @param keys - The `keys` of the lists to pop from.
|
|
2132
|
-
* @param timeout - The `timeout` in seconds.
|
|
2133
|
-
*
|
|
2134
|
-
* Command Response - An `array` containing the `key` from which the element was popped and the value of the popped element,
|
|
2135
|
-
* formatted as [key, value]. If no element could be popped and the timeout expired, returns `null`.
|
|
2136
|
-
*/
|
|
2137
|
-
blpop(keys: GlideString[], timeout: number): T;
|
|
2138
|
-
/** Adds all elements to the HyperLogLog data structure stored at the specified `key`.
|
|
2139
|
-
* Creates a new structure if the `key` does not exist.
|
|
2140
|
-
* When no elements are provided, and `key` exists and is a HyperLogLog, then no operation is performed.
|
|
2141
|
-
*
|
|
2142
|
-
* @see {@link https://valkey.io/commands/pfadd/|valkey.io} for details.
|
|
2143
|
-
*
|
|
2144
|
-
* @param key - The key of the HyperLogLog data structure to add elements into.
|
|
2145
|
-
* @param elements - An array of members to add to the HyperLogLog stored at `key`.
|
|
2146
|
-
* Command Response - If the HyperLogLog is newly created, or if the HyperLogLog approximated cardinality is
|
|
2147
|
-
* altered, then returns `1`. Otherwise, returns `0`.
|
|
2148
|
-
*/
|
|
2149
|
-
pfadd(key: GlideString, elements: GlideString[]): T;
|
|
2150
|
-
/** Estimates the cardinality of the data stored in a HyperLogLog structure for a single key or
|
|
2151
|
-
* calculates the combined cardinality of multiple keys by merging their HyperLogLogs temporarily.
|
|
2152
|
-
*
|
|
2153
|
-
* @see {@link https://valkey.io/commands/pfcount/|valkey.io} for details.
|
|
2154
|
-
*
|
|
2155
|
-
* @param keys - The keys of the HyperLogLog data structures to be analyzed.
|
|
2156
|
-
* Command Response - The approximated cardinality of given HyperLogLog data structures.
|
|
2157
|
-
* The cardinality of a key that does not exist is `0`.
|
|
2158
|
-
*/
|
|
2159
|
-
pfcount(keys: GlideString[]): T;
|
|
2160
|
-
/**
|
|
2161
|
-
* Merges multiple HyperLogLog values into a unique value. If the destination variable exists, it is
|
|
2162
|
-
* treated as one of the source HyperLogLog data sets, otherwise a new HyperLogLog is created.
|
|
2163
|
-
*
|
|
2164
|
-
* @see {@link https://valkey.io/commands/pfmerge/|valkey.io} for details.
|
|
2165
|
-
*
|
|
2166
|
-
* @param destination - The key of the destination HyperLogLog where the merged data sets will be stored.
|
|
2167
|
-
* @param sourceKeys - The keys of the HyperLogLog structures to be merged.
|
|
2168
|
-
* Command Response - A simple "OK" response.
|
|
2169
|
-
*/
|
|
2170
|
-
pfmerge(destination: GlideString, sourceKeys: GlideString[]): T;
|
|
2171
|
-
/**
|
|
2172
|
-
* Returns the internal encoding for the Valkey object stored at `key`.
|
|
2173
|
-
*
|
|
2174
|
-
* @see {@link https://valkey.io/commands/object-encoding/|valkey.io} for more details.
|
|
2175
|
-
*
|
|
2176
|
-
* @param key - The `key` of the object to get the internal encoding of.
|
|
2177
|
-
*
|
|
2178
|
-
* Command Response - If `key` exists, returns the internal encoding of the object stored at `key` as a string.
|
|
2179
|
-
* Otherwise, returns None.
|
|
2180
|
-
*/
|
|
2181
|
-
objectEncoding(key: GlideString): T;
|
|
2182
|
-
/**
|
|
2183
|
-
* Returns the logarithmic access frequency counter of a Valkey object stored at `key`.
|
|
2184
|
-
*
|
|
2185
|
-
* @see {@link https://valkey.io/commands/object-freq/|valkey.io} for more details.
|
|
2186
|
-
*
|
|
2187
|
-
* @param key - The `key` of the object to get the logarithmic access frequency counter of.
|
|
2188
|
-
*
|
|
2189
|
-
* Command Response - If `key` exists, returns the logarithmic access frequency counter of
|
|
2190
|
-
* the object stored at `key` as a `number`. Otherwise, returns `null`.
|
|
2191
|
-
*/
|
|
2192
|
-
objectFreq(key: GlideString): T;
|
|
2193
|
-
/**
|
|
2194
|
-
* Returns the time in seconds since the last access to the value stored at `key`.
|
|
2195
|
-
*
|
|
2196
|
-
* @see {@link https://valkey.io/commands/object-idletime/|valkey.io} for details.
|
|
2197
|
-
*
|
|
2198
|
-
* @param key - The key of the object to get the idle time of.
|
|
2199
|
-
*
|
|
2200
|
-
* Command Response - If `key` exists, returns the idle time in seconds. Otherwise, returns `null`.
|
|
2201
|
-
*/
|
|
2202
|
-
objectIdletime(key: GlideString): T;
|
|
2203
|
-
/**
|
|
2204
|
-
* Returns the reference count of the object stored at `key`.
|
|
2205
|
-
*
|
|
2206
|
-
* @see {@link https://valkey.io/commands/object-refcount/|valkey.io} for details.
|
|
2207
|
-
*
|
|
2208
|
-
* @param key - The `key` of the object to get the reference count of.
|
|
2209
|
-
*
|
|
2210
|
-
* Command Response - If `key` exists, returns the reference count of the object stored at `key` as a `number`.
|
|
2211
|
-
* Otherwise, returns `null`.
|
|
2212
|
-
*/
|
|
2213
|
-
objectRefcount(key: GlideString): T;
|
|
2214
|
-
/**
|
|
2215
|
-
* Displays a piece of generative computer art and the server version.
|
|
2216
|
-
*
|
|
2217
|
-
* @see {@link https://valkey.io/commands/lolwut/|valkey.io} for details.
|
|
2218
|
-
*
|
|
2219
|
-
* @param options - (Optional) The LOLWUT options - see {@link LolwutOptions}.
|
|
2220
|
-
*
|
|
2221
|
-
* Command Response - A piece of generative computer art along with the current server version.
|
|
2222
|
-
*/
|
|
2223
|
-
lolwut(options?: LolwutOptions): T;
|
|
2224
|
-
/**
|
|
2225
|
-
* Blocks the current client until all the previous write commands are successfully transferred and
|
|
2226
|
-
* acknowledged by at least `numreplicas` of replicas. If `timeout` is reached, the command returns
|
|
2227
|
-
* the number of replicas that were not yet reached.
|
|
2228
|
-
*
|
|
2229
|
-
* @see {@link https://valkey.io/commands/wait/|valkey.io} for more details.
|
|
2230
|
-
*
|
|
2231
|
-
* @param numreplicas - The number of replicas to reach.
|
|
2232
|
-
* @param timeout - The timeout value specified in milliseconds. A value of 0 will block indefinitely.
|
|
2233
|
-
*
|
|
2234
|
-
* Command Response - The number of replicas reached by all the writes performed in the context of the
|
|
2235
|
-
* current connection.
|
|
2236
|
-
*/
|
|
2237
|
-
wait(numreplicas: number, timeout: number): T;
|
|
2238
|
-
/**
|
|
2239
|
-
* Invokes a previously loaded function.
|
|
2240
|
-
*
|
|
2241
|
-
* @see {@link https://valkey.io/commands/fcall/|valkey.io} for details.
|
|
2242
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2243
|
-
*
|
|
2244
|
-
* @param func - The function name.
|
|
2245
|
-
* @param keys - A list of `keys` accessed by the function. To ensure the correct execution of functions,
|
|
2246
|
-
* all names of keys that a function accesses must be explicitly provided as `keys`.
|
|
2247
|
-
* @param args - A list of `function` arguments and it should not represent names of keys.
|
|
2248
|
-
*
|
|
2249
|
-
* Command Response - The invoked function's return value.
|
|
2250
|
-
*/
|
|
2251
|
-
fcall(func: GlideString, keys: GlideString[], args: GlideString[]): T;
|
|
2252
|
-
/**
|
|
2253
|
-
* Invokes a previously loaded read-only function.
|
|
2254
|
-
*
|
|
2255
|
-
* @see {@link https://valkey.io/commands/fcall/|valkey.io} for details.
|
|
2256
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2257
|
-
*
|
|
2258
|
-
* @param func - The function name.
|
|
2259
|
-
* @param keys - A list of `keys` accessed by the function. To ensure the correct execution of functions,
|
|
2260
|
-
* all names of keys that a function accesses must be explicitly provided as `keys`.
|
|
2261
|
-
* @param args - A list of `function` arguments and it should not represent names of keys.
|
|
2262
|
-
*
|
|
2263
|
-
* Command Response - The invoked function's return value.
|
|
2264
|
-
*/
|
|
2265
|
-
fcallReadonly(func: GlideString, keys: GlideString[], args: GlideString[]): T;
|
|
2266
|
-
/**
|
|
2267
|
-
* Deletes a library and all its functions.
|
|
2268
|
-
*
|
|
2269
|
-
* @see {@link https://valkey.io/commands/function-delete/|valkey.io} for details.
|
|
2270
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2271
|
-
*
|
|
2272
|
-
* @param libraryCode - The library name to delete.
|
|
2273
|
-
*
|
|
2274
|
-
* Command Response - `"OK"`.
|
|
2275
|
-
*/
|
|
2276
|
-
functionDelete(libraryCode: GlideString): T;
|
|
2277
|
-
/**
|
|
2278
|
-
* Loads a library to Valkey.
|
|
2279
|
-
*
|
|
2280
|
-
* @see {@link https://valkey.io/commands/function-load/|valkey.io} for details.
|
|
2281
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2282
|
-
*
|
|
2283
|
-
* @param libraryCode - The source code that implements the library.
|
|
2284
|
-
* @param replace - (Optional) Whether the given library should overwrite a library with the same name if it
|
|
2285
|
-
* already exists.
|
|
2286
|
-
*
|
|
2287
|
-
* Command Response - The library name that was loaded.
|
|
2288
|
-
*/
|
|
2289
|
-
functionLoad(libraryCode: GlideString, replace?: boolean): T;
|
|
2290
|
-
/**
|
|
2291
|
-
* Deletes all function libraries.
|
|
2292
|
-
*
|
|
2293
|
-
* @see {@link https://valkey.io/commands/function-flush/|valkey.io} for details.
|
|
2294
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2295
|
-
*
|
|
2296
|
-
* @param mode - (Optional) The flushing mode, could be either {@link FlushMode.SYNC} or {@link FlushMode.ASYNC}.
|
|
2297
|
-
* Command Response - `"OK"`.
|
|
2298
|
-
*/
|
|
2299
|
-
functionFlush(mode?: FlushMode): T;
|
|
2300
|
-
/**
|
|
2301
|
-
* Returns information about the functions and libraries.
|
|
2302
|
-
*
|
|
2303
|
-
* @see {@link https://valkey.io/commands/function-list/|valkey.io} for details.
|
|
2304
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2305
|
-
*
|
|
2306
|
-
* @param options - (Optional) Parameters to filter and request additional info.
|
|
2307
|
-
*
|
|
2308
|
-
* Command Response - Info about all or selected libraries and their functions in {@link FunctionListResponse} format.
|
|
2309
|
-
*/
|
|
2310
|
-
functionList(options?: FunctionListOptions): T;
|
|
2311
|
-
/**
|
|
2312
|
-
* Returns information about the function that's currently running and information about the
|
|
2313
|
-
* available execution engines.
|
|
2314
|
-
*
|
|
2315
|
-
* @see {@link https://valkey.io/commands/function-stats/|valkey.io} for details.
|
|
2316
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2317
|
-
*
|
|
2318
|
-
* Command Response - A `Record` of type {@link FunctionStatsSingleResponse} with two keys:
|
|
2319
|
-
*
|
|
2320
|
-
* - `"running_script"` with information about the running script.
|
|
2321
|
-
* - `"engines"` with information about available engines and their stats.
|
|
2322
|
-
*/
|
|
2323
|
-
functionStats(): T;
|
|
2324
|
-
/**
|
|
2325
|
-
* Returns the serialized payload of all loaded libraries.
|
|
2326
|
-
*
|
|
2327
|
-
* @see {@link https://valkey.io/commands/function-dump/|valkey.io} for details.
|
|
2328
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2329
|
-
* @remarks To execute a transaction with a `functionDump` command, the `exec` command requires `Decoder.Bytes` to handle the response.
|
|
2330
|
-
*
|
|
2331
|
-
* Command Response - The serialized payload of all loaded libraries.
|
|
2332
|
-
*/
|
|
2333
|
-
functionDump(): T;
|
|
2334
|
-
/**
|
|
2335
|
-
* Restores libraries from the serialized payload returned by {@link functionDump}.
|
|
2336
|
-
*
|
|
2337
|
-
* @see {@link https://valkey.io/commands/function-restore/|valkey.io} for details.
|
|
2338
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2339
|
-
*
|
|
2340
|
-
* @param payload - The serialized data from {@link functionDump}.
|
|
2341
|
-
* @param policy - (Optional) A policy for handling existing libraries.
|
|
2342
|
-
*
|
|
2343
|
-
* Command Response - `"OK"`.
|
|
2344
|
-
*/
|
|
2345
|
-
functionRestore(payload: Buffer, policy?: FunctionRestorePolicy): T;
|
|
2346
|
-
/**
|
|
2347
|
-
* Deletes all the keys of all the existing databases. This command never fails.
|
|
2348
|
-
*
|
|
2349
|
-
* @see {@link https://valkey.io/commands/flushall/|valkey.io} for details.
|
|
2350
|
-
*
|
|
2351
|
-
* @param mode - (Optional) The flushing mode, could be either {@link FlushMode.SYNC} or {@link FlushMode.ASYNC}.
|
|
2352
|
-
*
|
|
2353
|
-
* Command Response - `"OK"`.
|
|
2354
|
-
*/
|
|
2355
|
-
flushall(mode?: FlushMode): T;
|
|
2356
|
-
/**
|
|
2357
|
-
* Deletes all the keys of the currently selected database. This command never fails.
|
|
2358
|
-
*
|
|
2359
|
-
* @see {@link https://valkey.io/commands/flushdb/|valkey.io} for details.
|
|
2360
|
-
*
|
|
2361
|
-
* @param mode - (Optional) The flushing mode, could be either {@link FlushMode.SYNC} or {@link FlushMode.ASYNC}.
|
|
2362
|
-
*
|
|
2363
|
-
* Command Response - `"OK"`.
|
|
2364
|
-
*/
|
|
2365
|
-
flushdb(mode?: FlushMode): T;
|
|
2366
|
-
/**
|
|
2367
|
-
* Returns the index of the first occurrence of `element` inside the list specified by `key`. If no
|
|
2368
|
-
* match is found, `null` is returned. If the `count` option is specified, then the function returns
|
|
2369
|
-
* an `array` of indices of matching elements within the list.
|
|
2370
|
-
*
|
|
2371
|
-
* @see {@link https://valkey.io/commands/lpos/|valkey.io} for details.
|
|
2372
|
-
* @remarks Since Valkey version 6.0.6.
|
|
2373
|
-
*
|
|
2374
|
-
* @param key - The name of the list.
|
|
2375
|
-
* @param element - The value to search for within the list.
|
|
2376
|
-
* @param options - (Optional) The LPOS options - see {@link LPosOptions}.
|
|
2377
|
-
*
|
|
2378
|
-
* Command Response - The index of `element`, or `null` if `element` is not in the list. If the `count`
|
|
2379
|
-
* option is specified, then the function returns an `array` of indices of matching elements within the list.
|
|
2380
|
-
*/
|
|
2381
|
-
lpos(key: GlideString, element: GlideString, options?: LPosOptions): T;
|
|
2382
|
-
/**
|
|
2383
|
-
* Returns the number of keys in the currently selected database.
|
|
2384
|
-
*
|
|
2385
|
-
* @see {@link https://valkey.io/commands/dbsize/|valkey.io} for details.
|
|
2386
|
-
*
|
|
2387
|
-
* Command Response - The number of keys in the currently selected database.
|
|
2388
|
-
*/
|
|
2389
|
-
dbsize(): T;
|
|
2390
|
-
/**
|
|
2391
|
-
* Counts the number of set bits (population counting) in the string stored at `key`. The `options` argument can
|
|
2392
|
-
* optionally be provided to count the number of bits in a specific string interval.
|
|
2393
|
-
*
|
|
2394
|
-
* @see {@link https://valkey.io/commands/bitcount/|valkey.io} for more details.
|
|
2395
|
-
*
|
|
2396
|
-
* @param key - The key for the string to count the set bits of.
|
|
2397
|
-
* @param options - The offset options - see {@link BitOffsetOptions}.
|
|
2398
|
-
*
|
|
2399
|
-
* Command Response - If `options` is provided, returns the number of set bits in the string interval specified by `options`.
|
|
2400
|
-
* If `options` is not provided, returns the number of set bits in the string stored at `key`.
|
|
2401
|
-
* Otherwise, if `key` is missing, returns `0` as it is treated as an empty string.
|
|
2402
|
-
*/
|
|
2403
|
-
bitcount(key: GlideString, options?: BitOffsetOptions): T;
|
|
2404
|
-
/**
|
|
2405
|
-
* Adds geospatial members with their positions to the specified sorted set stored at `key`.
|
|
2406
|
-
* If a member is already a part of the sorted set, its position is updated.
|
|
2407
|
-
*
|
|
2408
|
-
* @see {@link https://valkey.io/commands/geoadd/|valkey.io} for details.
|
|
2409
|
-
*
|
|
2410
|
-
* @param key - The key of the sorted set.
|
|
2411
|
-
* @param membersToGeospatialData - A mapping of member names to their corresponding positions - see
|
|
2412
|
-
* {@link GeospatialData}. The command will report an error when the user attempts to index
|
|
2413
|
-
* coordinates outside the specified ranges.
|
|
2414
|
-
* @param options - The GeoAdd options - see {@link GeoAddOptions}.
|
|
2415
|
-
*
|
|
2416
|
-
* Command Response - The number of elements added to the sorted set. If `changed` is set to
|
|
2417
|
-
* `true` in the options, returns the number of elements updated in the sorted set.
|
|
2418
|
-
*/
|
|
2419
|
-
geoadd(key: GlideString, membersToGeospatialData: Map<GlideString, GeospatialData>, options?: GeoAddOptions): T;
|
|
2420
|
-
/**
|
|
2421
|
-
* Returns the members of a sorted set populated with geospatial information using {@link geoadd},
|
|
2422
|
-
* which are within the borders of the area specified by a given shape.
|
|
2423
|
-
*
|
|
2424
|
-
* @see {@link https://valkey.io/commands/geosearch/|valkey.io} for details.
|
|
2425
|
-
* @remarks Since Valkey version 6.2.0.
|
|
2426
|
-
*
|
|
2427
|
-
* @param key - The key of the sorted set.
|
|
2428
|
-
* @param searchFrom - The query's center point options, could be one of:
|
|
2429
|
-
*
|
|
2430
|
-
* - {@link MemberOrigin} to use the position of the given existing member in the sorted set.
|
|
2431
|
-
*
|
|
2432
|
-
* - {@link CoordOrigin} to use the given longitude and latitude coordinates.
|
|
2433
|
-
*
|
|
2434
|
-
* @param searchBy - The query's shape options, could be one of:
|
|
2435
|
-
*
|
|
2436
|
-
* - {@link GeoCircleShape} to search inside circular area according to given radius.
|
|
2437
|
-
*
|
|
2438
|
-
* - {@link GeoBoxShape} to search inside an axis-aligned rectangle, determined by height and width.
|
|
2439
|
-
*
|
|
2440
|
-
* @param resultOptions - The optional inputs to request additional information and configure sorting/limiting the results, see {@link GeoSearchResultOptions}.
|
|
2441
|
-
*
|
|
2442
|
-
* Command Response - By default, returns an `Array` of members (locations) names.
|
|
2443
|
-
* If any of `withCoord`, `withDist` or `withHash` are set to `true` in {@link GeoSearchResultOptions}, a 2D `Array` returned,
|
|
2444
|
-
* where each sub-array represents a single item in the following order:
|
|
2445
|
-
*
|
|
2446
|
-
* - The member (location) name.
|
|
2447
|
-
* - The distance from the center as a floating point `number`, in the same unit specified for `searchBy`.
|
|
2448
|
-
* - The geohash of the location as a integer `number`.
|
|
2449
|
-
* - The coordinates as a two item `array` of floating point `number`s.
|
|
2450
|
-
*/
|
|
2451
|
-
geosearch(key: GlideString, searchFrom: SearchOrigin, searchBy: GeoSearchShape, resultOptions?: GeoSearchResultOptions): T;
|
|
2452
|
-
/**
|
|
2453
|
-
* Searches for members in a sorted set stored at `source` representing geospatial data
|
|
2454
|
-
* within a circular or rectangular area and stores the result in `destination`.
|
|
2455
|
-
*
|
|
2456
|
-
* If `destination` already exists, it is overwritten. Otherwise, a new sorted set will be created.
|
|
2457
|
-
*
|
|
2458
|
-
* To get the result directly, see {@link geosearch}.
|
|
2459
|
-
*
|
|
2460
|
-
* @see {@link https://valkey.io/commands/geosearchstore/|valkey.io} for details.
|
|
2461
|
-
* @remarks Since Valkey version 6.2.0.
|
|
2462
|
-
*
|
|
2463
|
-
* @param destination - The key of the destination sorted set.
|
|
2464
|
-
* @param source - The key of the sorted set.
|
|
2465
|
-
* @param searchFrom - The query's center point options, could be one of:
|
|
2466
|
-
* - {@link MemberOrigin} to use the position of the given existing member in the sorted set.
|
|
2467
|
-
* - {@link CoordOrigin} to use the given longitude and latitude coordinates.
|
|
2468
|
-
* @param searchBy - The query's shape options, could be one of:
|
|
2469
|
-
* - {@link GeoCircleShape} to search inside circular area according to given radius.
|
|
2470
|
-
* - {@link GeoBoxShape} to search inside an axis-aligned rectangle, determined by height and width.
|
|
2471
|
-
* @param resultOptions - (Optional) Parameters to request additional information and configure sorting/limiting the results, see {@link GeoSearchStoreResultOptions}.
|
|
2472
|
-
*
|
|
2473
|
-
* Command Response - The number of elements in the resulting sorted set stored at `destination`.
|
|
2474
|
-
*/
|
|
2475
|
-
geosearchstore(destination: GlideString, source: GlideString, searchFrom: SearchOrigin, searchBy: GeoSearchShape, resultOptions?: GeoSearchStoreResultOptions): T;
|
|
2476
|
-
/**
|
|
2477
|
-
* Returns the positions (longitude, latitude) of all the specified `members` of the
|
|
2478
|
-
* geospatial index represented by the sorted set at `key`.
|
|
2479
|
-
*
|
|
2480
|
-
* @see {@link https://valkey.io/commands/geopos/|valkey.io} for more details.
|
|
2481
|
-
*
|
|
2482
|
-
* @param key - The key of the sorted set.
|
|
2483
|
-
* @param members - The members for which to get the positions.
|
|
2484
|
-
*
|
|
2485
|
-
* Command Response - A 2D `Array` which represents positions (longitude and latitude) corresponding to the
|
|
2486
|
-
* given members. The order of the returned positions matches the order of the input members.
|
|
2487
|
-
* If a member does not exist, its position will be `null`.
|
|
2488
|
-
*/
|
|
2489
|
-
geopos(key: GlideString, members: GlideString[]): T;
|
|
2490
|
-
/**
|
|
2491
|
-
* Pops member-score pairs from the first non-empty sorted set, with the given `keys`
|
|
2492
|
-
* being checked in the order they are provided.
|
|
2493
|
-
*
|
|
2494
|
-
* @see {@link https://valkey.io/commands/zmpop/|valkey.io} for details.
|
|
2495
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2496
|
-
*
|
|
2497
|
-
* @param keys - The keys of the sorted sets.
|
|
2498
|
-
* @param modifier - The element pop criteria - either {@link ScoreFilter.MIN} or
|
|
2499
|
-
* {@link ScoreFilter.MAX} to pop the member with the lowest/highest score accordingly.
|
|
2500
|
-
* @param count - (Optional) The number of elements to pop. If not supplied, only one element will be popped.
|
|
2501
|
-
*
|
|
2502
|
-
* Command Response - A two-element `array` containing the key name of the set from which the
|
|
2503
|
-
* was popped, and a `GlideRecord<number>` of the popped elements - see {@link GlideRecord}.
|
|
2504
|
-
* If no member could be popped, returns `null`.
|
|
2505
|
-
*/
|
|
2506
|
-
zmpop(keys: GlideString[], modifier: ScoreFilter, count?: number): T;
|
|
2507
|
-
/**
|
|
2508
|
-
* Pops a member-score pair from the first non-empty sorted set, with the given `keys` being
|
|
2509
|
-
* checked in the order they are provided. Blocks the connection when there are no members
|
|
2510
|
-
* to pop from any of the given sorted sets. `BZMPOP` is the blocking variant of {@link zmpop}.
|
|
2511
|
-
*
|
|
2512
|
-
* @see {@link https://valkey.io/commands/bzmpop/|valkey.io} for details.
|
|
2513
|
-
* @remarks `BZMPOP` is a client blocking command, see {@link https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#blocking-commands | Valkey Glide Wiki} for more details and best practices.
|
|
2514
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2515
|
-
*
|
|
2516
|
-
* @param keys - The keys of the sorted sets.
|
|
2517
|
-
* @param modifier - The element pop criteria - either {@link ScoreFilter.MIN} or
|
|
2518
|
-
* {@link ScoreFilter.MAX} to pop the member with the lowest/highest score accordingly.
|
|
2519
|
-
* @param timeout - The number of seconds to wait for a blocking operation to complete. A value of `0` will block indefinitely.
|
|
2520
|
-
* @param count - (Optional) The number of elements to pop. If not supplied, only one element will be popped.
|
|
2521
|
-
*
|
|
2522
|
-
* Command Response - A two-element `array` containing the key name of the set from which the element
|
|
2523
|
-
* was popped, and a `GlideRecord<number>` of the popped elements - see {@link GlideRecord}.
|
|
2524
|
-
* If no member could be popped, returns `null`.
|
|
2525
|
-
*/
|
|
2526
|
-
bzmpop(keys: GlideString[], modifier: ScoreFilter, timeout: number, count?: number): T;
|
|
2527
|
-
/**
|
|
2528
|
-
* Increments the score of `member` in the sorted set stored at `key` by `increment`.
|
|
2529
|
-
* If `member` does not exist in the sorted set, it is added with `increment` as its score.
|
|
2530
|
-
* If `key` does not exist, a new sorted set is created with the specified member as its sole member.
|
|
2531
|
-
*
|
|
2532
|
-
* @see {@link https://valkey.io/commands/zincrby/|valkey.io} for details.
|
|
2533
|
-
*
|
|
2534
|
-
* @param key - The key of the sorted set.
|
|
2535
|
-
* @param increment - The score increment.
|
|
2536
|
-
* @param member - A member of the sorted set.
|
|
2537
|
-
*
|
|
2538
|
-
* Command Response - The new score of `member`.
|
|
2539
|
-
*/
|
|
2540
|
-
zincrby(key: GlideString, increment: number, member: GlideString): T;
|
|
2541
|
-
/**
|
|
2542
|
-
* Iterates incrementally over a sorted set.
|
|
2543
|
-
*
|
|
2544
|
-
* @see {@link https://valkey.io/commands/zscan/|valkey.io} for more details.
|
|
2545
|
-
*
|
|
2546
|
-
* @param key - The key of the sorted set.
|
|
2547
|
-
* @param cursor - The cursor that points to the next iteration of results. A value of `"0"` indicates the start of
|
|
2548
|
-
* the search.
|
|
2549
|
-
* @param options - (Optional) The `zscan` options - see {@link ZScanOptions}
|
|
2550
|
-
*
|
|
2551
|
-
* Command Response - An `Array` of the `cursor` and the subset of the sorted set held by `key`.
|
|
2552
|
-
* The first element is always the `cursor` for the next iteration of results. `0` will be the `cursor`
|
|
2553
|
-
* returned on the last iteration of the sorted set. The second element is always an `Array` of the subset
|
|
2554
|
-
* of the sorted set held in `key`. The `Array` in the second element is a flattened series of
|
|
2555
|
-
* `String` pairs, where the value is at even indices and the score is at odd indices.
|
|
2556
|
-
* If `options.noScores` is to `true`, the second element will only contain the members without scores.
|
|
2557
|
-
*/
|
|
2558
|
-
zscan(key: GlideString, cursor: string, options?: ZScanOptions): T;
|
|
2559
|
-
/**
|
|
2560
|
-
* Returns the distance between `member1` and `member2` saved in the geospatial index stored at `key`.
|
|
2561
|
-
*
|
|
2562
|
-
* @see {@link https://valkey.io/commands/geodist/|valkey.io} for details.
|
|
2563
|
-
*
|
|
2564
|
-
* @param key - The key of the sorted set.
|
|
2565
|
-
* @param member1 - The name of the first member.
|
|
2566
|
-
* @param member2 - The name of the second member.
|
|
2567
|
-
* @param options - (Optional) Additional parameters:
|
|
2568
|
-
* - (Optional) `unit`: the unit of distance measurement - see {@link GeoUnit}.
|
|
2569
|
-
* If not specified, the {@link GeoUnit.METERS} is used as a default unit.
|
|
2570
|
-
*
|
|
2571
|
-
* Command Response - The distance between `member1` and `member2`. Returns `null`, if one or both members do not exist,
|
|
2572
|
-
* or if the key does not exist.
|
|
2573
|
-
*/
|
|
2574
|
-
geodist(key: GlideString, member1: GlideString, member2: GlideString, options?: {
|
|
2575
|
-
unit?: GeoUnit;
|
|
2576
|
-
}): T;
|
|
2577
|
-
/**
|
|
2578
|
-
* Returns the `GeoHash` strings representing the positions of all the specified `members` in the sorted set stored at `key`.
|
|
2579
|
-
*
|
|
2580
|
-
* @see {@link https://valkey.io/commands/geohash/|valkey.io} for details.
|
|
2581
|
-
*
|
|
2582
|
-
* @param key - The key of the sorted set.
|
|
2583
|
-
* @param members - The array of members whose `GeoHash` strings are to be retrieved.
|
|
2584
|
-
*
|
|
2585
|
-
* Command Response - An array of `GeoHash` strings representing the positions of the specified members stored at `key`.
|
|
2586
|
-
* If a member does not exist in the sorted set, a `null` value is returned for that member.
|
|
2587
|
-
*/
|
|
2588
|
-
geohash(key: GlideString, members: GlideString[]): T;
|
|
2589
|
-
/**
|
|
2590
|
-
* Returns `UNIX TIME` of the last DB save timestamp or startup timestamp if no save
|
|
2591
|
-
* was made since then.
|
|
2592
|
-
*
|
|
2593
|
-
* @see {@link https://valkey.io/commands/lastsave/|valkey.io} for details.
|
|
2594
|
-
*
|
|
2595
|
-
* Command Response - `UNIX TIME` of the last DB save executed with success.
|
|
2596
|
-
*/
|
|
2597
|
-
lastsave(): T;
|
|
2598
|
-
/**
|
|
2599
|
-
* Returns all the longest common subsequences combined between strings stored at `key1` and `key2`.
|
|
2600
|
-
*
|
|
2601
|
-
* @see {@link https://valkey.io/commands/lcs/|valkey.io} for details.
|
|
2602
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2603
|
-
*
|
|
2604
|
-
* @param key1 - The key that stores the first string.
|
|
2605
|
-
* @param key2 - The key that stores the second string.
|
|
2606
|
-
*
|
|
2607
|
-
* Command Response - A `String` containing all the longest common subsequence combined between the 2 strings.
|
|
2608
|
-
* An empty `String` is returned if the keys do not exist or have no common subsequences.
|
|
2609
|
-
*/
|
|
2610
|
-
lcs(key1: GlideString, key2: GlideString): T;
|
|
2611
|
-
/**
|
|
2612
|
-
* Returns the total length of all the longest common subsequences between strings stored at `key1` and `key2`.
|
|
2613
|
-
*
|
|
2614
|
-
* @see {@link https://valkey.io/commands/lcs/|valkey.io} for details.
|
|
2615
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2616
|
-
*
|
|
2617
|
-
* @param key1 - The key that stores the first string.
|
|
2618
|
-
* @param key2 - The key that stores the second string.
|
|
2619
|
-
*
|
|
2620
|
-
* Command Response - The total length of all the longest common subsequences between the 2 strings.
|
|
2621
|
-
*/
|
|
2622
|
-
lcsLen(key1: GlideString, key2: GlideString): T;
|
|
2623
|
-
/**
|
|
2624
|
-
* Returns the indices and lengths of the longest common subsequences between strings stored at
|
|
2625
|
-
* `key1` and `key2`.
|
|
2626
|
-
*
|
|
2627
|
-
* @see {@link https://valkey.io/commands/lcs/|valkey.io} for details.
|
|
2628
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2629
|
-
*
|
|
2630
|
-
* @param key1 - The key that stores the first string.
|
|
2631
|
-
* @param key2 - The key that stores the second string.
|
|
2632
|
-
* @param options - (Optional) Additional parameters:
|
|
2633
|
-
* - (Optional) `withMatchLen`: if `true`, include the length of the substring matched for the each match.
|
|
2634
|
-
* - (Optional) `minMatchLen`: the minimum length of matches to include in the result.
|
|
2635
|
-
*
|
|
2636
|
-
* Command Response - A {@link GlideRecord} containing the indices of the longest common subsequences between
|
|
2637
|
-
* the 2 strings and the lengths of the longest common subsequences. The resulting map contains two
|
|
2638
|
-
* keys, "matches" and "len":
|
|
2639
|
-
* - `"len"` is mapped to the total length of the all longest common subsequences between the 2 strings
|
|
2640
|
-
* stored as an integer. This value doesn't count towards the `minMatchLen` filter.
|
|
2641
|
-
* - `"matches"` is mapped to a three dimensional array of integers that stores pairs
|
|
2642
|
-
* of indices that represent the location of the common subsequences in the strings held
|
|
2643
|
-
* by `key1` and `key2`.
|
|
2644
|
-
*
|
|
2645
|
-
* See example of {@link BaseClient.lcsIdx|lcsIdx} for more details.
|
|
2646
|
-
*/
|
|
2647
|
-
lcsIdx(key1: GlideString, key2: GlideString, options?: {
|
|
2648
|
-
withMatchLen?: boolean;
|
|
2649
|
-
minMatchLen?: number;
|
|
2650
|
-
}): T;
|
|
2651
|
-
/**
|
|
2652
|
-
* Updates the last access time of the specified keys.
|
|
2653
|
-
*
|
|
2654
|
-
* @see {@link https://valkey.io/commands/touch/|valkey.io} for details.
|
|
2655
|
-
*
|
|
2656
|
-
* @param keys - The keys to update the last access time of.
|
|
2657
|
-
*
|
|
2658
|
-
* Command Response - The number of keys that were updated. A key is ignored if it doesn't exist.
|
|
2659
|
-
*/
|
|
2660
|
-
touch(keys: GlideString[]): T;
|
|
2661
|
-
/**
|
|
2662
|
-
* Returns a random existing key name from the currently selected database.
|
|
2663
|
-
*
|
|
2664
|
-
* @see {@link https://valkey.io/commands/randomkey/|valkey.io} for details.
|
|
2665
|
-
*
|
|
2666
|
-
* Command Response - A random existing key name from the currently selected database.
|
|
2667
|
-
*/
|
|
2668
|
-
randomKey(): T;
|
|
2669
|
-
/**
|
|
2670
|
-
* Overwrites part of the string stored at `key`, starting at the specified byte `offset`,
|
|
2671
|
-
* for the entire length of `value`. If the `offset` is larger than the current length of the string at `key`,
|
|
2672
|
-
* the string is padded with zero bytes to make `offset` fit. Creates the `key` if it doesn't exist.
|
|
2673
|
-
*
|
|
2674
|
-
* @see {@link https://valkey.io/commands/setrange/|valkey.io} for details.
|
|
2675
|
-
*
|
|
2676
|
-
* @param key - The key of the string to update.
|
|
2677
|
-
* @param offset - The byte position in the string where `value` should be written.
|
|
2678
|
-
* @param value - The string written with `offset`.
|
|
2679
|
-
*
|
|
2680
|
-
* Command Response - The length of the string stored at `key` after it was modified.
|
|
2681
|
-
*/
|
|
2682
|
-
setrange(key: GlideString, offset: number, value: GlideString): T;
|
|
2683
|
-
/**
|
|
2684
|
-
* Appends a `value` to a `key`. If `key` does not exist it is created and set as an empty string,
|
|
2685
|
-
* so `APPEND` will be similar to {@link set} in this special case.
|
|
2686
|
-
*
|
|
2687
|
-
* @see {@link https://valkey.io/commands/append/|valkey.io} for details.
|
|
2688
|
-
*
|
|
2689
|
-
* @param key - The key of the string.
|
|
2690
|
-
* @param value - The key of the string.
|
|
2691
|
-
*
|
|
2692
|
-
* Command Response - The length of the string after appending the value.
|
|
2693
|
-
*/
|
|
2694
|
-
append(key: GlideString, value: GlideString): T;
|
|
2695
|
-
/**
|
|
2696
|
-
* Pops one or more elements from the first non-empty list from the provided `keys`.
|
|
2697
|
-
*
|
|
2698
|
-
* @see {@link https://valkey.io/commands/lmpop/|valkey.io} for details.
|
|
2699
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2700
|
-
*
|
|
2701
|
-
* @param keys - An array of keys to lists.
|
|
2702
|
-
* @param direction - The direction based on which elements are popped from - see {@link ListDirection}.
|
|
2703
|
-
* @param count - (Optional) The maximum number of popped elements.
|
|
2704
|
-
*
|
|
2705
|
-
* Command Response - A `Record` which stores the key name where elements were popped out and the array of popped elements.
|
|
2706
|
-
*/
|
|
2707
|
-
lmpop(keys: GlideString[], direction: ListDirection, count?: number): T;
|
|
2708
|
-
/**
|
|
2709
|
-
* Blocks the connection until it pops one or more elements from the first non-empty list from the
|
|
2710
|
-
* provided `key`. `BLMPOP` is the blocking variant of {@link lmpop}.
|
|
2711
|
-
*
|
|
2712
|
-
* @see {@link https://valkey.io/commands/blmpop/|valkey.io} for details.
|
|
2713
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2714
|
-
*
|
|
2715
|
-
* @param keys - An array of keys to lists.
|
|
2716
|
-
* @param direction - The direction based on which elements are popped from - see {@link ListDirection}.
|
|
2717
|
-
* @param timeout - The number of seconds to wait for a blocking operation to complete. A value of
|
|
2718
|
-
* `0` will block indefinitely.
|
|
2719
|
-
* @param count - (Optional) The maximum number of popped elements.
|
|
2720
|
-
*
|
|
2721
|
-
* Command Response - A `Record` which stores the key name where elements were popped out and the array of popped elements.
|
|
2722
|
-
* If no member could be popped and the timeout expired, returns `null`.
|
|
2723
|
-
*/
|
|
2724
|
-
blmpop(keys: GlideString[], direction: ListDirection, timeout: number, count?: number): T;
|
|
2725
|
-
/**
|
|
2726
|
-
* Lists the currently active channels.
|
|
2727
|
-
* The command is routed to all nodes, and aggregates the response to a single array.
|
|
2728
|
-
*
|
|
2729
|
-
* @see {@link https://valkey.io/commands/pubsub-channels/|valkey.io} for more details.
|
|
2730
|
-
*
|
|
2731
|
-
* @param pattern - A glob-style pattern to match active channels.
|
|
2732
|
-
* If not provided, all active channels are returned.
|
|
2733
|
-
* Command Response - A list of currently active channels matching the given pattern.
|
|
2734
|
-
* If no pattern is specified, all active channels are returned.
|
|
2735
|
-
*/
|
|
2736
|
-
pubsubChannels(pattern?: GlideString): T;
|
|
2737
|
-
/**
|
|
2738
|
-
* Returns the number of unique patterns that are subscribed to by clients.
|
|
2739
|
-
*
|
|
2740
|
-
* Note: This is the total number of unique patterns all the clients are subscribed to,
|
|
2741
|
-
* not the count of clients subscribed to patterns.
|
|
2742
|
-
* The command is routed to all nodes, and aggregates the response to the sum of all pattern subscriptions.
|
|
2743
|
-
*
|
|
2744
|
-
* @see {@link https://valkey.io/commands/pubsub-numpat/|valkey.io} for more details.
|
|
2745
|
-
*
|
|
2746
|
-
* Command Response - The number of unique patterns.
|
|
2747
|
-
*/
|
|
2748
|
-
pubsubNumPat(): T;
|
|
2749
|
-
/**
|
|
2750
|
-
* Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels.
|
|
2751
|
-
*
|
|
2752
|
-
* @see {@link https://valkey.io/commands/pubsub-numsub/|valkey.io} for more details.
|
|
2753
|
-
*
|
|
2754
|
-
* @param channels - The list of channels to query for the number of subscribers.
|
|
2755
|
-
*
|
|
2756
|
-
* Command Response - A list of the channel names and their numbers of subscribers.
|
|
2757
|
-
*/
|
|
2758
|
-
pubsubNumSub(channels: GlideString[]): T;
|
|
2759
|
-
/**
|
|
2760
|
-
* Sorts the elements in the list, set, or sorted set at `key` and returns the result.
|
|
2761
|
-
*
|
|
2762
|
-
* The `sort` command can be used to sort elements based on different criteria and
|
|
2763
|
-
* apply transformations on sorted elements.
|
|
2764
|
-
*
|
|
2765
|
-
* To store the result into a new key, see {@link sortStore}.
|
|
2766
|
-
*
|
|
2767
|
-
* @see {@link https://valkey.io/commands/sort/|valkey.io} for more details.
|
|
2768
|
-
* @remarks When in cluster mode, both `key` and the patterns specified in {@link SortOptions.byPattern}
|
|
2769
|
-
* and {@link SortOptions.getPatterns} must map to the same hash slot. The use of {@link SortOptions.byPattern}
|
|
2770
|
-
* and {@link SortOptions.getPatterns} in cluster mode is supported since Valkey version 8.0.
|
|
2771
|
-
*
|
|
2772
|
-
* @param key - The key of the list, set, or sorted set to be sorted.
|
|
2773
|
-
* @param options - (Optional) {@link SortOptions}.
|
|
2774
|
-
*
|
|
2775
|
-
* Command Response - An `Array` of sorted elements.
|
|
2776
|
-
*/
|
|
2777
|
-
sort(key: GlideString, options?: SortOptions): T;
|
|
2778
|
-
/**
|
|
2779
|
-
* Sorts the elements in the list, set, or sorted set at `key` and returns the result.
|
|
2780
|
-
*
|
|
2781
|
-
* The `sortReadOnly` command can be used to sort elements based on different criteria and
|
|
2782
|
-
* apply transformations on sorted elements.
|
|
2783
|
-
*
|
|
2784
|
-
* This command is routed depending on the client's {@link ReadFrom} strategy.
|
|
2785
|
-
*
|
|
2786
|
-
* @remarks Since Valkey version 7.0.0.
|
|
2787
|
-
* @remarks When in cluster mode, both `key` and the patterns specified in {@link SortOptions.byPattern}
|
|
2788
|
-
* and {@link SortOptions.getPatterns} must map to the same hash slot. The use of {@link SortOptions.byPattern}
|
|
2789
|
-
* and {@link SortOptions.getPatterns} in cluster mode is supported since Valkey version 8.0.
|
|
2790
|
-
*
|
|
2791
|
-
* @param key - The key of the list, set, or sorted set to be sorted.
|
|
2792
|
-
* @param options - (Optional) {@link SortOptions}.
|
|
2793
|
-
*
|
|
2794
|
-
* Command Response - An `Array` of sorted elements
|
|
2795
|
-
*/
|
|
2796
|
-
sortReadOnly(key: GlideString, options?: SortOptions): T;
|
|
2797
|
-
/**
|
|
2798
|
-
* Sorts the elements in the list, set, or sorted set at `key` and stores the result in
|
|
2799
|
-
* `destination`.
|
|
2800
|
-
*
|
|
2801
|
-
* The `sort` command can be used to sort elements based on different criteria and
|
|
2802
|
-
* apply transformations on sorted elements, and store the result in a new key.
|
|
2803
|
-
*
|
|
2804
|
-
* To get the sort result without storing it into a key, see {@link sort} or {@link sortReadOnly}.
|
|
2805
|
-
*
|
|
2806
|
-
* @see {@link https://valkey.io/commands/sort/|valkey.io} for more details.
|
|
2807
|
-
* @remarks When in cluster mode, `key`, `destination` and the patterns specified in {@link SortOptions.byPattern}
|
|
2808
|
-
* and {@link SortOptions.getPatterns} must map to the same hash slot. The use of {@link SortOptions.byPattern}
|
|
2809
|
-
* and {@link SortOptions.getPatterns} in cluster mode is supported since Valkey version 8.0.
|
|
2810
|
-
*
|
|
2811
|
-
* @param key - The key of the list, set, or sorted set to be sorted.
|
|
2812
|
-
* @param destination - The key where the sorted result will be stored.
|
|
2813
|
-
* @param options - (Optional) {@link SortOptions}.
|
|
2814
|
-
*
|
|
2815
|
-
* Command Response - The number of elements in the sorted key stored at `destination`.
|
|
2816
|
-
*/
|
|
2817
|
-
sortStore(key: GlideString, destination: GlideString, options?: SortOptions): T;
|
|
2818
|
-
}
|
|
2819
|
-
/**
|
|
2820
|
-
* Extends BaseTransaction class for Valkey standalone commands.
|
|
2821
|
-
* Transactions allow the execution of a group of commands in a single step.
|
|
2822
|
-
*
|
|
2823
|
-
* Command Response:
|
|
2824
|
-
* An array of command responses is returned by the GlideClient.exec command, in the order they were given.
|
|
2825
|
-
* Each element in the array represents a command given to the transaction.
|
|
2826
|
-
* The response for each command depends on the executed Valkey command.
|
|
2827
|
-
* Specific response types are documented alongside each method.
|
|
2828
|
-
*
|
|
2829
|
-
* @example
|
|
2830
|
-
* ```typescript
|
|
2831
|
-
* const transaction = new Transaction()
|
|
2832
|
-
* .set("key", "value")
|
|
2833
|
-
* .select(1) /// Standalone command
|
|
2834
|
-
* .get("key");
|
|
2835
|
-
* const result = await GlideClient.exec(transaction);
|
|
2836
|
-
* console.log(result); // Output: ['OK', 'OK', null]
|
|
2837
|
-
* ```
|
|
2838
|
-
*/
|
|
2839
|
-
export declare class Transaction extends BaseTransaction<Transaction> {
|
|
2840
|
-
/**
|
|
2841
|
-
* Change the currently selected database.
|
|
2842
|
-
*
|
|
2843
|
-
* @see {@link https://valkey.io/commands/select/|valkey.io} for details.
|
|
2844
|
-
*
|
|
2845
|
-
* @param index - The index of the database to select.
|
|
2846
|
-
*
|
|
2847
|
-
* Command Response - A simple `"OK"` response.
|
|
2848
|
-
*/
|
|
2849
|
-
select(index: number): Transaction;
|
|
2850
|
-
/**
|
|
2851
|
-
* Copies the value stored at the `source` to the `destination` key. If `destinationDB` is specified,
|
|
2852
|
-
* the value will be copied to the database specified, otherwise the current database will be used.
|
|
2853
|
-
* When `replace` is true, removes the `destination` key first if it already exists, otherwise performs
|
|
2854
|
-
* no action.
|
|
2855
|
-
*
|
|
2856
|
-
* @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
|
|
2857
|
-
* @remarks Since Valkey version 6.2.0.
|
|
2858
|
-
*
|
|
2859
|
-
* @param source - The key to the source value.
|
|
2860
|
-
* @param destination - The key where the value should be copied to.
|
|
2861
|
-
* @param destinationDB - (Optional) The alternative logical database index for the destination key.
|
|
2862
|
-
* If not provided, the current database will be used.
|
|
2863
|
-
* @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
|
|
2864
|
-
* value to it. If not provided, no action will be performed if the key already exists.
|
|
2865
|
-
*
|
|
2866
|
-
* Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
|
|
2867
|
-
*/
|
|
2868
|
-
copy(source: GlideString, destination: GlideString, options?: {
|
|
2869
|
-
destinationDB?: number;
|
|
2870
|
-
replace?: boolean;
|
|
2871
|
-
}): Transaction;
|
|
2872
|
-
/**
|
|
2873
|
-
* Move `key` from the currently selected database to the database specified by `dbIndex`.
|
|
2874
|
-
*
|
|
2875
|
-
* @see {@link https://valkey.io/commands/move/|valkey.io} for details.
|
|
2876
|
-
*
|
|
2877
|
-
* @param key - The key to move.
|
|
2878
|
-
* @param dbIndex - The index of the database to move `key` to.
|
|
2879
|
-
*
|
|
2880
|
-
* Command Response - `true` if `key` was moved, or `false` if the `key` already exists in the destination
|
|
2881
|
-
* database or does not exist in the source database.
|
|
2882
|
-
*/
|
|
2883
|
-
move(key: GlideString, dbIndex: number): Transaction;
|
|
2884
|
-
/** Publish a message on pubsub channel.
|
|
2885
|
-
*
|
|
2886
|
-
* @see {@link https://valkey.io/commands/publish/|valkey.io} for more details.
|
|
2887
|
-
*
|
|
2888
|
-
* @param message - Message to publish.
|
|
2889
|
-
* @param channel - Channel to publish the message on.
|
|
2890
|
-
*
|
|
2891
|
-
* Command Response - Number of subscriptions in primary node that received the message.
|
|
2892
|
-
* Note that this value does not include subscriptions that configured on replicas.
|
|
2893
|
-
*/
|
|
2894
|
-
publish(message: GlideString, channel: GlideString): Transaction;
|
|
2895
|
-
}
|
|
2896
|
-
/**
|
|
2897
|
-
* Extends BaseTransaction class for cluster mode commands.
|
|
2898
|
-
* Transactions allow the execution of a group of commands in a single step.
|
|
2899
|
-
*
|
|
2900
|
-
* Command Response:
|
|
2901
|
-
* An array of command responses is returned by the GlideClusterClient.exec command, in the order they were given.
|
|
2902
|
-
* Each element in the array represents a command given to the transaction.
|
|
2903
|
-
* The response for each command depends on the executed Valkey command.
|
|
2904
|
-
* Specific response types are documented alongside each method.
|
|
2905
|
-
*
|
|
2906
|
-
*/
|
|
2907
|
-
export declare class ClusterTransaction extends BaseTransaction<ClusterTransaction> {
|
|
2908
|
-
/**
|
|
2909
|
-
* Copies the value stored at the `source` to the `destination` key. When `replace` is true,
|
|
2910
|
-
* removes the `destination` key first if it already exists, otherwise performs no action.
|
|
2911
|
-
*
|
|
2912
|
-
* @see {@link https://valkey.io/commands/copy/|valkey.io} for details.
|
|
2913
|
-
* @remarks Since Valkey version 6.2.0.
|
|
2914
|
-
*
|
|
2915
|
-
* @param source - The key to the source value.
|
|
2916
|
-
* @param destination - The key where the value should be copied to.
|
|
2917
|
-
* @param replace - (Optional) If `true`, the `destination` key should be removed before copying the
|
|
2918
|
-
* value to it. If not provided, no action will be performed if the key already exists.
|
|
2919
|
-
*
|
|
2920
|
-
* Command Response - `true` if `source` was copied, `false` if the `source` was not copied.
|
|
2921
|
-
*/
|
|
2922
|
-
copy(source: GlideString, destination: GlideString, options?: {
|
|
2923
|
-
replace?: boolean;
|
|
2924
|
-
}): ClusterTransaction;
|
|
2925
|
-
/** Publish a message on pubsub channel.
|
|
2926
|
-
* This command aggregates PUBLISH and SPUBLISH commands functionalities.
|
|
2927
|
-
* The mode is selected using the 'sharded' parameter.
|
|
2928
|
-
* For both sharded and non-sharded mode, request is routed using hashed channel as key.
|
|
2929
|
-
*
|
|
2930
|
-
* @see {@link https://valkey.io/commands/publish} and {@link https://valkey.io/commands/spublish} for more details.
|
|
2931
|
-
*
|
|
2932
|
-
* @param message - Message to publish.
|
|
2933
|
-
* @param channel - Channel to publish the message on.
|
|
2934
|
-
* @param sharded - Use sharded pubsub mode. Available since Valkey version 7.0.
|
|
2935
|
-
*
|
|
2936
|
-
* Command Response - Number of subscriptions in primary node that received the message.
|
|
2937
|
-
*/
|
|
2938
|
-
publish(message: GlideString, channel: GlideString, sharded?: boolean): ClusterTransaction;
|
|
2939
|
-
/**
|
|
2940
|
-
* Lists the currently active shard channels.
|
|
2941
|
-
* The command is routed to all nodes, and aggregates the response to a single array.
|
|
2942
|
-
*
|
|
2943
|
-
* @see {@link https://valkey.io/commands/pubsub-shardchannels|valkey.io} for more details.
|
|
2944
|
-
*
|
|
2945
|
-
* @param pattern - A glob-style pattern to match active shard channels.
|
|
2946
|
-
* If not provided, all active shard channels are returned.
|
|
2947
|
-
*
|
|
2948
|
-
* Command Response - A list of currently active shard channels matching the given pattern.
|
|
2949
|
-
* If no pattern is specified, all active shard channels are returned.
|
|
2950
|
-
*/
|
|
2951
|
-
pubsubShardChannels(pattern?: GlideString): ClusterTransaction;
|
|
2952
|
-
/**
|
|
2953
|
-
* Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified shard channels.
|
|
2954
|
-
*
|
|
2955
|
-
* @see {@link https://valkey.io/commands/pubsub-shardnumsub|valkey.io} for more details.
|
|
2956
|
-
* @remarks The command is routed to all nodes, and aggregates the response into a single list.
|
|
2957
|
-
*
|
|
2958
|
-
* @param channels - The list of shard channels to query for the number of subscribers.
|
|
2959
|
-
*
|
|
2960
|
-
* Command Response - A list of the shard channel names and their numbers of subscribers.
|
|
2961
|
-
*/
|
|
2962
|
-
pubsubShardNumSub(channels: GlideString[]): ClusterTransaction;
|
|
2963
|
-
}
|