Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msg.hasOwnProperty('measurement') returns undefined using examples #127

Open
ArcherThompson opened this issue Aug 31, 2022 · 0 comments
Open

Comments

@ArcherThompson
Copy link

I am using the V2 influxDB
"No measurement specified" is thrown in Node-red

this appears to be because msg.hasOwnProperty('measurement') returns undefined instead of an bool.
The example has no measurement property. Adding a measurement property does not help.

so the following always returns false:
var measurement = msg.hasOwnProperty('measurement') ? msg.measurement : node.measurement; if (!measurement) { return done(RED._("influxdb.errors.nomeasurement")); }

The following example was used:

msg.payload = [ [{ intValue: '9i', numValue: 10, randomValue: Math.random()*10, strValue: "message1", time: new Date().getTime()-1 }, { tag1:"sensor1", tag2:"device2" }], [{ intValue: '11i', numValue: 20, randomValue: Math.random()*10, strValue: "message2", time: new Date().getTime() }, { tag1:"sensor1", tag2:"device2" }] ]; return msg;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant