Skip to content

Commit 802539b

Browse files
committed
update docs for MULTI exception
1 parent a867200 commit 802539b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,17 @@ Redis. The interface in `node_redis` is to return an individual `Multi` object
411411
});
412412
```
413413

414+
### Multi.exec( callback )
415+
414416
`client.multi()` is a constructor that returns a `Multi` object. `Multi` objects share all of the
415417
same command methods as `client` objects do. Commands are queued up inside the `Multi` object
416418
until `Multi.exec()` is invoked.
417419

420+
The `callback` of `.exec()` will get invoked with two arguments:
421+
422+
* `err` **type:** `null | Array` err is either null or an array of Error Objects corresponding the the sequence the commands where chained. The last item of the array will always be an `EXECABORT` type of error originating from the `.exec()` itself.
423+
* `results` **type:** `null | Array` results is an array of responses corresponding the the sequence the commands where chained.
424+
418425
You can either chain together `MULTI` commands as in the above example, or you can queue individual
419426
commands while still sending regular client command as in this example:
420427

0 commit comments

Comments
 (0)