PDA

View Full Version : Writer insert sends array or object



TopKatz
16 Mar 2010, 7:54 AM
Im using a store with a writer with some success. I however ran into an issue when I have the store handle both single and batch inserts.

When I have the store insert a single item, data goes out as a single object. When I insert a batch, it goes out as an array of objects in data. Is there a way to tell the writer to always send out an array of objects, even if its just one?

Having to handle both on the back end is a little ugly.

Katz

EDIT - listful:true in the writer config does the trick. RTFM!!!!

sandeep45
26 Aug 2011, 10:15 AM
i have a store associated with a model. when i create a new record of that model type and add it to the store and then do sync() on the store, it then sends the json with the data in an array. the request looks like this:
{"notes":[{"body":"dsfs","id":""}]}
how can i make it as an object not as an array. i would like it to look like:
{"note":{"body":"dsfs","id":""}}