I need to get a value from the request in Parse.com's javascript cloud code, for a param that I'm fetching dynamically.
It goes like this. I'm getting a list of key objects from the datastore, and for each one I get the actual key:
var key = keyObject.get("Key");
console.log("key = " + key);
The key here is printed correctly. For example it can be IsActionMovie
.
Now I need to see if a value for this key exists in my request.
var valueFromRequestForKey = request.params.key;
console.log("valueFromRequestForKey = " + valueFromRequestForKey);
The printout here is always undefined
.
Needless to say this works:
var valueFromRequestForKey = request.params.IsActionMovie;
So how do I do it dynamically?