Skip to content

Commit ccf4c99

Browse files
author
Ruben Bridgewater
committed
Update readme and changelog
1 parent 3514a32 commit ccf4c99

File tree

2 files changed

+44
-16
lines changed

2 files changed

+44
-16
lines changed

README.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ This will display:
5050
1: hashtest 2
5151
mjr:~/work/node_redis (master)$
5252

53-
Note that the API is entire asynchronous. To get data back from the server,
54-
you'll need to use a callback. The return value from most of the API is a
55-
backpressure indicator.
53+
Note that the API is entire asynchronous. To get data back from the server, you'll need to use a callback.
5654

5755
### Promises
5856

@@ -115,9 +113,8 @@ For a list of Redis commands, see [Redis Command Reference](http://redis.io/comm
115113

116114
The commands can be specified in uppercase or lowercase for convenience. `client.get()` is the same as `client.GET()`.
117115

118-
Minimal parsing is done on the replies. Commands that return a single line reply return JavaScript Strings,
119-
integer replies return JavaScript Numbers, "bulk" replies return node Buffers, and "multi bulk" replies return a
120-
JavaScript Array of node Buffers. `HGETALL` returns an Object with Buffers keyed by the hash keys.
116+
Minimal parsing is done on the replies. Commands that return a integer return JavaScript Numbers, arrays return JavaScript Array. `HGETALL` returns an Object keyed by the hash keys. All strings will either be returned as string or as buffer depending on your setting.
117+
Please be aware that sending null, undefined and Boolean values will result in the value coerced to a string!
121118

122119
# API
123120

@@ -173,23 +170,20 @@ port and host are probably fine and you don't need to supply any arguments. `cre
173170
* `redis.createClient()`
174171
* `redis.createClient(options)`
175172
* `redis.createClient(unix_socket, options)`
176-
* `redis.createClient('redis://user:pass@host:port', options)`
173+
* `redis.createClient(redis_url, options)`
177174
* `redis.createClient(port, host, options)`
178175

179176
#### `options` is an object with the following possible properties:
180177
* `host`: *127.0.0.1*; The host to connect to
181178
* `port`: *6370*; The port to connect to
182179
* `path`: *null*; The unix socket string to connect to
183-
* `url`: *null*; The redis url to connect to
180+
* `url`: *null*; The redis url to connect to (`[redis:]//[user][:password@][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]` For more info check [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis))
184181
* `parser`: *hiredis*; Which Redis protocol reply parser to use. If `hiredis` is not installed it will fallback to `javascript`.
185182
* `return_buffers`: *false*; If set to `true`, then all replies will be sent to callbacks as Buffers instead of Strings.
186183
* `detect_buffers`: *false*; If set to `true`, then replies will be sent to callbacks as Buffers. Please be aware that this can't work properly with the pubsub mode. A subscriber has to either always return strings or buffers.
187184
if any of the input arguments to the original command were Buffers.
188185
This option lets you switch between Buffers and Strings on a per-command basis, whereas `return_buffers` applies to
189186
every command on a client.
190-
* `socket_nodelay`: *true*; Disables the [Nagle algorithm](https://en.wikipedia.org/wiki/Nagle%27s_algorithm).
191-
Setting this option to `false` can result in additional throughput at the cost of more latency.
192-
Most applications will want this set to `true`.
193187
* `socket_keepalive` *true*; Whether the keep-alive functionality is enabled on the underlying socket.
194188
* `no_ready_check`: *false*; When a connection is established to the Redis server, the server might still
195189
be loading the database from disk. While loading the server will not respond to any commands. To work around this,
@@ -208,10 +202,11 @@ The value is provided in milliseconds and is counted from the moment on a new cl
208202
Default is to try connecting until the default system socket timeout has been exceeded and to try reconnecting until 1h passed.
209203
* `max_attempts`: *0*; By default client will try reconnecting until connected. Setting `max_attempts`
210204
limits total amount of connection tries. Setting this to 1 will prevent any reconnect tries.
211-
* `auth_pass`: *null*; If set, client will run redis auth command on connect.
205+
* `retry_unfulfilled_commands`: *false*; If set to true, all commands that were unfulfulled while the connection is lost will be retried after the connection has reestablished again. Use this with caution, if you use state altering commands (e.g. *incr*). This is especially useful if you use blocking commands.
206+
* `password`: *null*; If set, client will run redis auth command on connect. Alias `auth_pass`
207+
* `db`: *null*; If set, client will run redis select command on connect. This is [not recommended](https://groups.google.com/forum/#!topic/redis-db/vS5wX8X4Cjg).
212208
* `family`: *IPv4*; You can force using IPv6 if you set the family to 'IPv6'. See Node.js [net](https://nodejs.org/api/net.html) or [dns](https://nodejs.org/api/dns.html) modules how to use the family type.
213209
* `disable_resubscribing`: *false*; If set to `true`, a client won't resubscribe after disconnecting
214-
* `to_empty_string`: *null*; convert any undefined or null command argument to an empty string. Be careful using this
215210
* `rename_commands`: *null*; pass a object with renamed commands to use those instead of the original functions. See the [redis security topics](http://redis.io/topics/security) for more info.
216211
* `tls`: an object containing options to pass to [tls.connect](http://nodejs.org/api/tls.html#tls_tls_connect_port_host_options_callback),
217212
to set up a TLS connection to Redis (if, for example, it is set up to be accessible via a tunnel).

changelog.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,45 @@
11
Changelog
22
=========
33

4-
## v.2.5.0 - xx Dez, 2015
4+
## v.2.5.0-0 - xx Dez, 2015
55

66
Features
77

8-
- The parsers moved into the [redis-parser](https://github.com/NodeRedis/node-redis-parser) module and will be maintained in there from now on ([@BridgeAR](https://github.com/BridgeAR))
9-
- Improve js parser speed significantly for big SUNION/SINTER/LRANGE/ZRANGE ([@BridgeAR](https://github.com/BridgeAR))
8+
- The parsers moved into the [redis-parser](https://github.com/NodeRedis/node-redis-parser) module and will be maintained in there from now on
9+
- Improve js parser speed significantly for big SUNION/SINTER/LRANGE/ZRANGE
10+
- Improve redis-url parsing to also accept the database-number and options as query parameters as suggested in the [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis)
11+
- Added a `retry_unfulfilled_commands` option
12+
- Setting this to 'true' results in retrying all commands that were not fulfilled on a connection loss after the reconnect. Use with caution
13+
- Added a `db` option to select the database while connecting (this is [not recommended](https://groups.google.com/forum/#!topic/redis-db/vS5wX8X4Cjg))
14+
- Added a `password` option as alias for auth_pass
15+
- The client.server_info is from now on updated while using the info command
16+
17+
Bugfixes
18+
19+
- Fixed explicit undefined as a command callback in a multi context
20+
- Fixed hmset failing to detect the first key as buffer or date if the key is of that type
21+
- Fixed do not run toString on an array argument and throw a "invalid data" error instead
22+
- This is not considered as breaking change, as this is likely a error in your code and if you want to have such a behavior you should handle this beforehand
23+
- The same applies to Map / Set and individual Object types
24+
- Fixed redis url not accepting the protocol being omitted or protocols other than the redis protocol for convienence
25+
- Fixed parsing the db keyspace even if the first database does not begin with a zero
26+
- Fixed handling of errors occuring while receiving pub sub messages
27+
28+
Deprecations
29+
30+
- Using any command with a argument being set to null or undefined is deprecated
31+
- From v.3.0.0 on using a command with such an argument will return an error instead
32+
- If you want to keep the old behavior please use a precheck in your code that converts the arguments to a string.
33+
- Using SET or SETEX with a undefined or null value will from now on also result in converting the value to "null" / "undefined" to have a consistent behavior. This is not considered as breaking change, as it returned an error earlier.
34+
- Using .end(flush) without the flush parameter deprecated and the flush parameter should explicitly be used
35+
- From v.3.0.0 on using .end without flush will result in an error
36+
- Using .end without flush means that any command that did not yet return is going to silently fail. Therefor this is considered harmfull and you should explicitly silence such errors if you are sure you want this
37+
- Depending on the return value of a command to detect the backpressure is deprecated
38+
- From version 3.0.0 on node_redis might not return true / false as a return value anymore. Please rely on client.should_buffer instead
39+
- The socket_nodelay option is deprecated and will be removed in v.3.0.0
40+
- If you want to buffer commands you should use [.batch or .multi](./README.md) instead. This is necessary to reduce the amount of different options and this is very likely reducing your throughput if set to false.
41+
- If you are sure you want to activate the NAGLE algorithm you can still activate it by using client.stream.setNoDelay(false)
42+
- Redis < v. 2.6.11 is not supported anymore and will not work in all cases. Please update to a newer redis version
1043

1144
## v.2.4.2 - 27 Nov, 2015
1245

0 commit comments

Comments
 (0)