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.
4545| [ Command argument handling] ( #command-argument-handling ) | Argument objects flattened and items passed directly | Argument objects parsed to generate correct argument list |
4646| [ Asynchronous command result handling] ( #async-result ) | Callbacks and Promises | Promises only |
4747
48- ### Specific commands
48+ ### Techniques
4949
5050| Feature | ` ioredis ` | ` node-redis ` |
5151| :-- | :-- | :-- |
52+ | [ Pipelining] ( #pipelining ) | Automatic, or with ` pipeline() ` command | Automatic, or with ` multi() ` command |
5253
54+ ### Specific commands
5355
54- ### Techniques
55-
56- | Feature | ` ioredis ` | ` node-redis ` |
56+ | Command | ` ioredis ` | ` node-redis ` |
5757| :-- | :-- | :-- |
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 ` |
5959
6060## Details
6161
@@ -229,3 +229,20 @@ redis.multi()
229229 // Handle errors.
230230 });
231231```
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