File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed
content/develop/clients/nodejs Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -45,17 +45,17 @@ each feature.
45
45
| [ Command argument handling] ( #command-argument-handling ) | Argument objects flattened and items passed directly | Argument objects parsed to generate correct argument list |
46
46
| [ Asynchronous command result handling] ( #async-result ) | Callbacks and Promises | Promises only |
47
47
48
- ### Specific commands
48
+ ### Techniques
49
49
50
50
| Feature | ` ioredis ` | ` node-redis ` |
51
51
| :-- | :-- | :-- |
52
+ | [ Pipelining] ( #pipelining ) | Automatic, or with ` pipeline() ` command | Automatic, or with ` multi() ` command |
52
53
54
+ ### Specific commands
53
55
54
- ### Techniques
55
-
56
- | Feature | ` ioredis ` | ` node-redis ` |
56
+ | Command | ` ioredis ` | ` node-redis ` |
57
57
| :-- | :-- | :-- |
58
- | [ Pipelining ] ( #pipelining ) | Automatic, or with ` pipeline() ` command | Automatic, or with ` multi() ` command |
58
+ | [ ` SETNX ` ] ( #setnx-command ) | Supported explicitly | Supported as an option for ` SET ` |
59
59
60
60
## Details
61
61
@@ -229,3 +229,20 @@ redis.multi()
229
229
// Handle errors.
230
230
});
231
231
```
232
+
233
+ ### ` SETNX ` command
234
+
235
+ ` ioredis ` implements the [ ` SETNX ` ] ({{< relref "/commands/setnx" >}})
236
+ command with an explicit method:
237
+
238
+ ``` js
239
+ client .setnx (" bike:1" , " bike" );
240
+ ```
241
+
242
+ ` node-redis ` doesn't provide a ` SETNX ` method but implements the same
243
+ functionality with the ` NX ` option to the [ ` SET ` ] ({{< relref "/commands/set" >}})
244
+ command:
245
+
246
+ ``` js
247
+ await client .set (" bike:1" , " bike" , {' NX' : true });
248
+ ```
You can’t perform that action at this time.
0 commit comments