Is there a good object mapper for Amazons dynamodb(through aws sdk) which can be used in nodejs?

前端 未结 6 1780
难免孤独
难免孤独 2021-02-01 03:07

Maybe the question does not apply to dynamoDB due to it not being Relational Db. However, I\'m looking for a good object mapper which can be used in nodejs and aws sdk to map e

6条回答
  •  攒了一身酷
    2021-02-01 03:10

    Also worth considering is simple marshallers, which just translate between the dynamoDB format and regular js objects or JSON.

    DynamoDb-Data-Types
    https://github.com/kayomarz/dynamodb-data-types
    https://www.npmjs.com/package/dynamodb-data-types

    "This utility helps represent AWS DynamoDb data types. It maps (marshalls) JavaScript data into the format required by DynamoDb."

    dynamoDb-marshaler
    https://github.com/CascadeEnergy/dynamoDb-marshaler https://www.npmjs.com/package/dynamodb-marshaler

    "Translates sane javascript objects (and JSON) into DynamoDb format and vice versa." [does not support B type.]

    Update 2016-06:
    Just discovered that the AWS SDK now does this for you. Their documentation is only partially converted so I guess this is a recent addition. Read about it here.

    But these marshallers are still useful because there are circumstances where you can't use the new document client, eg. when processing a dynamoDB stream.

提交回复
热议问题