Skip to content

Commit cea3609

Browse files
Apply suggestions from code review
Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com>
1 parent 4901cd4 commit cea3609

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

content/develop/clients/nodejs/migration.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ each feature.
4343
| :-- | :-- | :-- |
4444
| [Command case](#command-case) | Lowercase only (eg, `hset`) | Uppercase or camel case (eg, `HSET` or `hSet`) |
4545
| [Command argument handling](#command-argument-handling) | Argument objects flattened and items passed directly | Argument objects parsed to generate correct argument list |
46-
| [Asynchronous command result handling](#async-result) | Callbacks and Promises | Promises and Callbacks (via Legacy Mode) |
46+
| [Asynchronous command result handling](#async-result) | Callbacks and Promises | Promises (but supports callbacks via Legacy Mode) |
4747
| [Arbitrary command execution](#arbitrary-command-execution) | Uses the `call()` method | Uses the `sendCommand()` method |
4848

4949
### Techniques
@@ -189,7 +189,7 @@ client.get('mykey').then(
189189
`node-redis` supports only `Promise` objects for results, so
190190
you must always use a `then()` handler or the
191191
[`await`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await)
192-
operator to receive them, however callbacks are still supported via the legacy mode:
192+
operator to receive them. However, you can still use callbacks with the legacy mode if you need them:
193193

194194
```js
195195
// Promise
@@ -354,9 +354,8 @@ command with an explicit method:
354354
client.setnx('bike:1', 'bike');
355355
```
356356

357-
`node-redis` provides a `SETNX` method but due to the command being deprecated the same
358-
functionality can be achieved with the `NX` option to the [`SET`]({{< relref "/commands/set" >}})
359-
command instead:
357+
`node-redis` provides a `SETNX` method but this command is deprecated. Use the `NX` option to the [`SET`]({{< relref "/commands/set" >}})
358+
command to get the same functionality as `SETNX`:
360359

361360
```js
362361
await client.set('bike:1', 'bike', {'NX': true});

0 commit comments

Comments
 (0)