Pull an entry from an array via Meteor

后端 未结 2 793
再見小時候
再見小時候 2020-12-16 02:50

I\'ve the following (simplified) SimpleSchema schema in my Meteor 1.1.0.2 app:

Tickers.attachSchema(
    new SimpleS         


        
2条回答
  •  一个人的身影
    2020-12-16 03:16

    Just to mention, if someone else is looking for an answer.

    If you are usein SimpleSchema, you have two options: the array field should be marked as optional

    arr: {
     type:Array,
     optional:true
    }
    

    Or use getAutoValues: false in update-query.

    Coll.update({}, {$pull: {arr: ''}}, {getAutoValues: false});
    

提交回复
热议问题