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:
- The collection will always be changed
- All models are essentially fresh, but you'd have to look at their id's to see if they are
new
or not. - You can't tell which have been deleted - unless you save a copy of the collection before, and do a pair by pair comparison.
精彩评论