开发者

After refreshing a collection, how to get the models that are changed?

After I refresh a Collection, is there a way to know i开发者_Python百科f the collection has changed and if so, to retrieve the individual models that are new, modified, or deleted ?


I recomend re-reading the documentation refresh. Refresh will remove ALL models from a collection, and then load only those models which you pass into it.

Therefore to answer your questions:

  1. The collection will always be changed
  2. All models are essentially fresh, but you'd have to look at their id's to see if they are new or not.
  3. You can't tell which have been deleted - unless you save a copy of the collection before, and do a pair by pair comparison.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜