Skip to content

Problem updating existing documents #2

Open
@nielsenk

Description

@nielsenk

Hello,

I have a question with regard to the node-red-node-cf-cloudant to Node-RED.
I’m trying to update existing documents in my Cloudant database. On the site you describe it as:
“For update and delete, you must pass the _id and the _rev as part of the input msg object.”

I have tried to utilize this, however, I just can’t get it to work.

`msg.payload = {
"_id": node.customID,
"_rev": node.guid,
"tankID": node.tankID,
"volume": node.volume,
"capacity": node.capacity
};

console.log(msg);
node.send(msg);`

The above code is what I sent as input to the Cloudant node.
The _id I’m setting is the same everytime the code is called. The _rev are changed each time.
In the configuration of the Cloudant node I have specified to only store the msg.payload object.
As far as I understand the _rev has to change to get the update to work?

I hope you can help me, cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions