If you specifically ask about Ember Data, I donโt know how to do it (I donโt think that you can use any equivalent of save () for the collection / array). There may be alternative data libraries that may work (for example, you can check Orbit.JS - this is what I haven't done yet)
As I did this, it has an endpoint on my backend that receives a specific JSON payload and creates resources. You do this by calling a regular ajax call, see this example (from my project).
let content = //get content that you want to post let accessToken = this.get('session.session.authenticated.token'); Ember.$.ajax({ data: JSON.stringify(content), dataType: 'json', method: 'POST', url: 'path/to/my/custom/end/point', headers: { 'Content-Type': 'application/json', 'Authorization': `Beader ${accessToken}` } }).then((result) => { // Code for success }, (jqXHR) => { // Code for error }).always(() => { // Code for always/finally });
As you can see, this is all user code, not the use of Ember Data storage or models. So far I have not found a better answer.
EDIT: After viewing the answer andorov. I forgot to say something. I am using Ember Data 2.0 (default is JSONAPI) and the EmbeddedRecordsMixin Property does not work with the JSON API
source share