dynamodb-geo.js
dynamodb-geo.js copied to clipboard
Compatible with DAX?
Hi,
Is this library somehow compatible with DAX? I think that reason that it doesn't work for us is because of #14 .
Does anyone managed to make it work with: https://www.npmjs.com/package/amazon-dax-client or Any DAX client?
@rh389 I managed to make the query to be compatible with DocumentClient(). You can see the change here: https://github.com/rh389/dynamodb-geo.js/compare/master...igorescobar:master
Not sure if it helps at all but I think it can be useful if someone ever needs to make it work with DocumentClient (required by DynamoDB DAX).
Hi @igorescobar. Thanks for this - looks like a good start and should be backwards compatible. Do you want to make a PR out of it?
One thing to watch out for - casting to Number will lose precision because javascript's Number can't store a full S2 cell ID (hence the use of long in this library) - in practice Number typically rounds the last three digits of a cell ID to 0. DynamoDB's numbers internally support 38 digits via string representation so they are safe, but we need to be careful not to lose precision on the client side.