How to use Meteor Upsert

前端 未结 4 772
悲哀的现实
悲哀的现实 2021-02-02 07:57

Having a bit of trouble getting my Meteor upsert function working. I am fairly (200 lines of code) new, and I\'m having a bit of trouble.

The collection keeps on having

4条回答
  •  长情又很酷
    2021-02-02 08:38

    Try this:

    values.update({"id":id},
           { $set: {
              value: res.data['data']['last']['value'],
              time: Date.now() // no need coma here
          } },
          { upsert: true }
        );
    

提交回复
热议问题