我对两者之间的差异感到困惑.似乎Collection.create()(触发添加和同步事件)可以看作Collection.add()(fires add)和Model.save()(触发同步)的组合?
以上评估是否正确?我错过了什么?
解决方法
那就对了.这是一种捷径方法.
Documentation states:
create
collection.create(attributes,[options])
Convenience to create
a new instance of a model within a collection. Equivalent to
instantiating a model with a hash of attributes,saving the model to
the server,and adding the model to the set after being successfully
created.
Create a new instance of a model in this collection. Add the model to
the collection immediately,unless wait: true is passed,in which case
we wait for the server to agree.