Meteor upsert equivalent

后端 未结 3 1753
遥遥无期
遥遥无期 2021-01-01 03:57

How soon will the upsert command be implemented in Meteor?

And, what is the best way to do the same thing in the mean time?

Something like this is what I\'m

3条回答
  •  情书的邮戳
    2021-01-01 04:28

    If you really want to do that, you can use the mongodb connection directly: MongoInternals.defaultRemoteCollectionDriver().mongo.db.collection('myCollection').update(query, update, {upsert: true}). Of course this connection is not documented so there is a chance that it can be changed in the future.

提交回复
热议问题