Fix for: boolean values converted to strings instead of numbers #20

wants to merge 1 commit into


None yet

2 participants

bfil commented Jul 11, 2012

Boolean values should be converted to numbers on DynamoDB, in this way we can have the following item with boolean properties:

var item = { hash: "whatever", isBetter: true, isWorse: false };

And it can be retrieved and tested in the following way:

var item = table.get_item({hash: "whatever"});
item.isBetter == true; // true
item.isWorse == false; // true

Because in Javascript (and many other languages):

1 == true; // true
0 == false; // true

This is a great fix, I'm going to pull this in for the next major update to dynode as this changes the way data is stored. I also have to add in some details to the readme about boolean handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment