Class RecordArray
A record array is an array that contains records of a certain modelName. The record
array materializes records as needed when they are retrieved for the first
time. You should not create record arrays yourself. Instead, an instance of
RecordArray
or its subclasses will be returned by your application's store
in response to queries.
_dissociateFromOwnRecords
Defined in ../store/addon/-private/system/record-arrays/record-array.js:233
_pushIdentifiers (identifiers)
Defined in ../store/addon/-private/system/record-arrays/record-array.js:247
- identifiers
- StableRecordIdentifier[]
Adds identifiers to the RecordArray
without duplicates
_removeIdentifiers (identifiers)
Defined in ../store/addon/-private/system/record-arrays/record-array.js:258
- identifiers
- StableRecordIdentifier[]
Removes identifiers from the RecordArray
.
_takeSnapshot
Defined in ../store/addon/-private/system/record-arrays/record-array.js:269
save PromiseArray
Defined in ../store/addon/-private/system/record-arrays/record-array.js:174
- returns
- PromiseArray
- promise
Saves all of the records in the RecordArray
.
Example
1 2 3 4 5 |
let messages = store.peekAll('message'); messages.forEach(function(message) { message.set('hasBeenSeen', true); }); messages.save(); |
update
Defined in ../store/addon/-private/system/record-arrays/record-array.js:127
Used to get the latest version of all of the records in this array from the adapter.
Example
1 2 3 4 5 6 7 8 |
let people = store.peekAll('person'); people.get('isUpdating'); // false people.update().then(function() { people.get('isUpdating'); // false }); people.get('isUpdating'); // true |