vogels icon indicating copy to clipboard operation
vogels copied to clipboard

version 0.x to 2.x deserializer

Open ehourigan opened this issue 9 years ago • 1 comments

Ryan,

First of all, thanks for a great project. I've been using this since 0.11 and find it invaluable. I recently upgraded to 2.2 for document support. Unfortunately, I have a significant amount of data (specifically dates and booleans) that rely on the 'old' deserializer. In the 0.x version, booleans are stored as Numbers inside Dynamo. After updating to 2.2, a GET on an item with a boolean returns a Number value (1/0) instead of true/false. Similarly with dates, I used to get a full JS date returned from a GET, but now only receive an ISO string. I understand that if I re-save the item the serializer will convert the number boolean to a true/false value.

Is there a plan to reintroduce the deserialization of data types back into the project? I have forked vogels and am adding support for my cases (booleans and dates). I would be happy to contribute back to vogels if you think this is a worthwhile endeavor.

ehourigan avatar Jan 13 '16 15:01 ehourigan

If you want to try putting together a pull request to support it would be great. As you said, returning data back from DynamoDB currently is very simple. How it should work is if a boolean or data attribute is declared attempt to convert the data over to the proper types. If its not possible to convert to the proper type we should still return the raw data stored in dynamo

ryanfitz avatar Jan 13 '16 16:01 ryanfitz