node-red-contrib-influxdb
node-red-contrib-influxdb copied to clipboard
Specifying retention policy in function node
I've been browsing for a clear example of a function node that specifies tag, values, retention policy, precision that I can work from, but having no luck. I've tried the following, but not seeing anything show up the database.
temp=msg.payload[0];
msg.payload={
fields: {
value:temp.count
},
tags: {
device:"Raspberry Pi"
}
};
msg.retentionPolicy={
value:"four_weeks"
};
msg.measurement={
value:"dbwrites"
};
return msg;
and
temp=msg.payload[0];
msg.payload={
// measurement:"dbwrites",
fields: {
value:temp.count
},
tags: {
device:"Raspberry Pi"
}
};
msg.retentionPolicy="four_weeks";
msg.measurement="dbwrites";
return msg;
and
temp=msg.payload[0];
msg.payload=[
{
value:temp.count
},
{
device:"Raspberry Pi"
}
];
msg.retentionPolicy="four_weeks";
msg.measurement="dbwrites";
return msg;
Should specify that entering the retention policy and measurement in the influxdb write node works just fine, but I was hoping to have a more generic influxdb write node that I could link multiple functions to, where RP and Measurement were passed in via functions.
Any ideas?