-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty arrays convert to objects with Redis backend since version 1.10 #96
Comments
@rehia Can you take a look at it? |
sure... Thanks! |
hi @juhoojala, I'd really need one of those examples. |
Hi @rehia, sorry for not getting back earlier!
var es = require('eventstore')({
type: 'redis',
host: 'localhost', // optional
port: 16379, // note that standard port is 6379
db: 0, // optional
prefix: 'eventstore', // optional
eventsCollectionName: 'test-events', // optional
snapshotsCollectionName: 'snapshots', // optional
timeout: 10000 // optional
});
es.init(function (err) {
console.log('Initialized');
es.getEventStream('streamId', function(err, stream) {
stream.addEvent({ my: 'event', arr: []});
stream.commit(function(err, stream) {
console.log('Event added');
es.getEvents('streamId', 0, 100, function(err, events) {
console.log('Returned event:');
console.log(events);
});
});
});
}); Output
I'm using node v.6.2.0 and the |
OK thanks @juhoojala for this. |
Thanks for maintaining this project!
Since version 1.10, arrays convert to objects when stored with a redis backend. Version 1.9 works fine.
This is caused by the new Lua scripts in this commit:
401c537
See below link for more information:
http://openmymind.net/Lua-JSON-turns-empty-arrays-into-empty-hashes/
The text was updated successfully, but these errors were encountered: