开发者

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

开发者 https://www.devze.com 2023-03-12 15:24 出处:网络
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-readi

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

精彩评论

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

关注公众号