Adding Collection#fetch with add: true

This commit is contained in:
Jeremy Ashkenas
2010-12-08 13:14:05 -05:00
2 changed files with 13 additions and 5 deletions

View File

@@ -1251,12 +1251,19 @@ Accounts.url = '/accounts';
Accounts.fetch();
</pre>
<p>
If you'd like to add the incoming models to the current collection, instead
of replacing the collection's contents, pass <tt>{add: true}</tt> as an
option to <b>fetch</b>.
</p>
<p>
Note that <b>fetch</b> should not be used to populate collections on
page load &mdash; all models needed at load time should already be
bootstrapped in to place. <b>fetch</b> is intended for lazily-loading models
for interfaces that are not needed immediately: for example, documents
with collections of notes that may be toggled open and closed.
<a href="#FAQ-bootstrap">bootstrapped</a> in to place. <b>fetch</b> is
intended for lazily-loading models for interfaces that are not needed
immediately: for example, documents with collections of notes that may be
toggled open and closed.
</p>
<p id="Collection-refresh">