Difference between model.save() versus model.get('store').commit()

前端 未结 1 1427
失恋的感觉
失恋的感觉 2021-01-02 05:23

What is the difference between

// \'this\' is the controller
this.get(\'model\').save();

and



        
相关标签:
1条回答
  • 2021-01-02 05:46

    Which one should I use?

    I'd recommend using this.get('model').save()

    what's the main difference between this.get('store').scheduleSave(this) and this.get('store').commit()?

    If you are saving many records during the same run loop, scheduleSave will batch changes so that multiple records will get saved in the same transaction. In some cases commit might cause changes to other records to be persisted.

    0 讨论(0)
提交回复
热议问题