thauburger/node_redis — comment on commit b2f65710add64604754efebff3e4a8664739a850
File: index.js line 690
By thauburger:

Added support for space-delimited commands (e.g.`DEBUG OBJECT`) by treating each word in the command as its own 'element' in the multi-bulk request. Prior to this change, send_command() failed to execute the 5 redis commands consisting of more than one word.

If we take the `DEBUG OBJECT` example:

The old approach bundled the command as a single element in the multi-bulk request:

````
*2
$12
DEBUG OBJECT
$7
testkey

````
This resulted in Redis returning the error: " ERR unknown command 'debug object' ".

The patched approach first parses the command string for multiple words, and then gives each word its own element in the request:

````
*3
$5
DEBUG
$6
OBJECT
$7
testkey
````
This results in the expected execution of all available Redis commands, and provides future-proofing for new commands consisting of multiple words.