Post
Topic
Board Services
Re: ANSWER SIMPLE MONGODB QUESTION: GET 0.05 BITCOINS :)
by
Lucky7Gaming
on 05/07/2016, 01:10:49 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.