How to use Meteor Upsert

前端 未结 4 773
悲哀的现实
悲哀的现实 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:47

    The above doesn't work for IDs. This works for me (with the same syntax as update):

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

提交回复
热议问题