-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Breaking changes between v1 and v2
Zihua 子骅 edited this page Jun 13, 2016
·
3 revisions
v1:
redis.on('authError', function () {});
v2:
redis.on('error', function () {});
v1:
redis.multi().hegetall('hashkey').exec();
// result for hgetall is ["a", "1", "b", "2"]
v2:
redis.multi().hegetall('hashkey').exec();
// result for hgetall is { a: "1", b: "2" }
This result format (either string or buffer) for each command inside a pipeline (or a transaction) is decided by the command itself (with or without the Buffer
postfix) instead of the last exec
and execBuffer
.
v1:
redis.multi().set('foo', 'bar').getBuffer('foo').exec(console.log);
// null [ [ null, 'OK' ], [ null, 'bar' ] ]
redis.multi().set('foo', 'bar').getBuffer('foo').execBuffer(console.log);
// null [ [ null, <Buffer 4f 4b> ], [ null, <Buffer 62 61 72> ] ]
v2:
redis.multi().set('foo', 'bar').getBuffer('foo').exec(console.log);
// null [ [ null, 'OK' ], [ null, <Buffer 62 61 72> ] ]
redis.multi().set('foo', 'bar').getBuffer('foo').execBuffer(console.log); // deprecated
// null [ [ null, 'OK' ], [ null, <Buffer 62 61 72> ] ]
-
Cluster#masterNodes
andCluster#nodes
is removed. UseCluster#nodes('masters')
andCluster#nodes('all')
instead. -
Cluster#to()
is removed. UsePromise.all(Cluster#nodes().map(function (node) {}))
instead. - Option
readOnly
is removed. Check outscaleReads
option. - Per-instance config passed to each
Redis
instance should be specified with theredisOptions
property of the cluster option.