Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

parse.com difference between request.object and request.params

I'm running through the parse.com tutorial,

https://www.parse.com/docs/cloud_code_guide

and it mentions that when i'm doing some cloud code, I should get the json values using request.params.someParam

All well and good, except the tutorial then immediately starts making calls to request.object.get("someParam")

What is the difference between request.object.get() and request.params.theParam? Is one better than the other? Is this a standard javascript thing that i should know (i don't know js a whole bunch)

like image 945
bharal Avatar asked Dec 15 '12 00:12

bharal


1 Answers

They are two different concepts. One is used in Cloud Functions, the other in object saving triggers.

  • request.params is used in Cloud Functions to access GET/POST parameters.

  • request.object is used in beforeSave/afterSave triggers to access the object being saved.

like image 95
Héctor Ramos Avatar answered Oct 21 '22 05:10

Héctor Ramos