0

I wanna speed up the process of saving (developement time) some objects on Parse and wonder if the following is possible:

I have an object called TestObject with the columns: testCol1, testCol2 ... testCol9. If I wanted to save an object of this kind and the client has to send a value for all these columns the code on the server (cloud-code) would be quite messy (unnecessary long). Example:

var col1 = request.params.col1;
var col2 = request.params.col2;
...
var col9 = request.params.col9;

And then when setting the these values on the actual object the process has to be kinda repeated. Is there a way I can do something like:

var TestObject = Parse.Object.extend("TestObject");
var testObject = new TestObject(JSON.stringify(request.params));
testObject.save();
Davin Tryon
  • 66,517
  • 15
  • 143
  • 132
Whyser
  • 2,187
  • 2
  • 20
  • 40
  • Any reason why you use Cloud Code in addition to the saving logic the SDK already implements? – Björn Kaiser Jan 12 '15 at 16:34
  • I wanna keep all the logic on the server and make REST-calls to the server to keep the client-side simple. Maybe I should have mentioned that I use the REST-api? Is what I'm asking possible? – Whyser Jan 12 '15 at 17:47

0 Answers0