JSData DS#inject documentation states that:
Injecting an item into the data store does not save it to the server.
There is a way to persist resources injected into DataStore?
Say, as example, that I modified multiple resources injecting them into DataStore, there is a way to persist all the modifications automatically?
What could be the best approach?
I am probably missing the point here.
Thank you.
In JSData 2.x, you can save individual records by calling DSSave
on the record itself, or by calling DS#save
and passing the primary key of the record to be saved. See http://www.js-data.io/v2.8/docs/dssave and http://www.js-data.io/v2.8/docs/dsupdate
In JSData 3.x (still in beta), there is a batch update (updateMany
) that can save multiple modified entities at once. See also: Saving data, Mapper#update, Record#save, DataStore#updateMany