W3cubDocs

/Ember.js 4

Class ManyArray

public
Defined in: ../packages/model/addon/-private/many-array.ts:38
Module: @ember-data/store

createRecord (hash) Model public

Module: @ember-data/store
hash
Object
returns
Model
record

Create a child record within the owner

reload public

Module: @ember-data/store

Reloads all of the records in the manyArray. If the manyArray holds a relationship that was originally fetched using a links url Ember Data will revisit the original links url to repopulate the relationship.

If the manyArray holds the result of a store.query() reload will re-run the original query.

Example

let user = store.peekRecord('user', '1')
await login(user);

let permissions = await user.permissions;
await permissions.reload();

save PromiseArray public

Module: @ember-data/store
returns
PromiseArray
promise

Saves all of the records in the ManyArray.

Example

let inbox = await store.findRecord('inbox', '1');
let messages = await inbox.messages;
messages.forEach((message) => {
  message.isRead = true;
});
messages.save();

© 2022 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember-data/4.9/classes/ManyArray/methods