Post
Topic
Board Services
Re: ANSWER SIMPLE MONGODB QUESTION: GET 0.05 BITCOINS :)
by
Lavander
on 05/07/2016, 01:15:37 UTC
If this helps any, I also tried

Code:
var resultArray=[];
    mongo.connect(url, function(err, db) {
    var cursor = db.collection('test_mqtt').find({"_id":"arduino01"},{"event.value":1,"_id":0});
         cursor.forEach(function(doc, err) {
         resultArray.push(doc.event);
}, function() {
  db.close();
  console.log(resultArray);
 
});

but the array isn't right.   I need to be able to grab (for only the device I want) a plain array of temperature values and a plain array for time values for a specified sensor.......and that's in some weird object format.   

and here i stuck as well.. sorry dude, but i thought it will be easiest. It looks like i'm out for tonight. I hope @grimo007 will find out what is going on Wink

Good luck guys!