From the code below, I would expect the console value to increase every time I run the save() function. However, the number does not update. So I'm not seeing any created values injected into the store on create.
Budget = DS.defineResource('budget')
function save(){
Budget.create(this.budgetItem, {upsert: true})
.then( ( ) => {
Budget.findAll().then((data)=>console.log(data.length))
})
}
I'm using jsdata-angular.
After the first save findAll() executes it will retreive records from the server and then cache them. After that it does not make future calls to the server when performing a findAll() (this is expected behavior) however it is also not injecting the newly created values into store either.
All my configs are left unchanged. I'm using all defaults.
DS#findAllis for retrieving records from a persistence layer via an adapter and loading them into the store. By default, if you make afindAllcall and then make the exact samefindAllcall again (with the samequeryargument), then instead of making a new request, JSData returns to you the original result. You can change this behavior two ways:useFiltertotrueto have yourfindAllinvocation callDS#filterand returning you the result.bypassCachetotrueto force the data to be reloaded via the adapter.As a general rule of thumb,
findAllis for asynchronously loading records into the store (e.g. via HTTP adapter GET request), andfilteris for synchronously selecting records out of the store when you need them (e.g. display them in your View).For example, in one place you do:
Then elsewhere: