Code Monkey home page Code Monkey logo

Comments (5)

MarcoBenini avatar MarcoBenini commented on August 13, 2024 1

For example using a "function" node to prepare data for putItem in a DynamoDB table.
Primary key: partition "dev_id" and sort time (ISO 8601 format).

let ISOdatetime = new Date(msg.payload).toISOString();

msg.Item = {
    "dev_id": {
        "S": "test_001"
    },
    "time": {
        "S": ISOdatetime
    }
}

return msg;

Description of "Item" can be found in AWS Javascript SDK documentation -> putItem -> Parameters
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#putItem-property

from node-red-contrib-aws.

Daniel-t avatar Daniel-t commented on August 13, 2024

Thanks @MarcoBenini

@Hugobox did this answer your question?

from node-red-contrib-aws.

TibGva avatar TibGva commented on August 13, 2024

Hi,
This is a great node, it works for me as explain above, now, I would like to "detect" or automatically convert from javascript types a bit like in https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/Converter.html

My difficulty is that I have a JSON object that I need to store containing around 50 different attributes, and I wonder if I could avoid to type each of the attribute type "S", "N", NULL, etc... but detect them automatically...

Does this make sense ? Is there a way to do this?

Thibaut

from node-red-contrib-aws.

Daniel-t avatar Daniel-t commented on August 13, 2024

I hadn't noticed the Converter object previously. It will need a special node, happy to look into this

from node-red-contrib-aws.

Daniel-t avatar Daniel-t commented on August 13, 2024

I've added a node the the repository (not published yet), please try it out. Cursory testing seems to be work as expected

from node-red-contrib-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.