documentcloud/backbone — pull request #987 by vincentbriglia (2012-02-10 19:00:57+00:00)
Title: This addresses Issue #955

I realise this doesn't necessarily fit into the ethos of Backbone, it being a direct mapping to the methodology of RESTful applications, regardless I amongst others thought this could be a very good addition to Backbone. It's especially handy there where serverside collections don't need to match clientside collections but are populated using the ```data``` option passed in ```collection.fetch``` which could potentially filter serverside requests.

The handy endresult of this is that existing models don't get destroyed, whereas the ```reset``` trigger would dictate you to re-render your views, using ```collection.update``` would merely update them and remove obsolete models from your collection.

__update existing models__:

```javascript
collection.fetch({update: true}); // either
collection.update(models); // or
```
__update existing models but prune missing__:

```javascript
collection.fetch({update: true, prune: true}); // either
collection.update(models, {prune: true}); // or
```