Post
Topic
Board Services
Re: ANSWER SIMPLE MONGODB QUESTION: GET 0.05 BITCOINS :)
by
Lucky7Gaming
on 05/07/2016, 01:38:44 UTC
I've been trying to save the data using,  
Code:
collection.update(  
  { _id:key },
  { $push:  { event: { value:String(payload), when:new Date() } }  },
  { upsert:true },
but maybe that's not the right way to go?  maybe some sort of nonformatted list is better............

changing it to not have events does give a better format I think

Code:
       "_id" : "device01",
        "value" : [
                "36.00",
                "23.60"
        ],
        "when" : [
                ISODate("2016-07-05T01:42:38.314Z"),
                ISODate("2016-07-05T01:42:43.631Z")
        ]