Is it possible to use a variable in a meteor collection update/removal?

前端 未结 3 547
粉色の甜心
粉色の甜心 2021-01-26 09:38

So I was thinking about refactoring my code in the following way.

Meteor.call(\"RemoveNotification\", this._id, function(error, response){
}

an

3条回答
  •  既然无缘
    2021-01-26 10:14

    I tried these a bit complex ways but then find the easies way - using the dburles:mongo-collection-instances package - https://atmospherejs.com/dburles/mongo-collection-instances It let's to access any collection by the collection name in variable:

    let collName = "blabla";
    Mongo.Collection.get(collName).find() // ... or any else
    

提交回复
热议问题