javascript - Parse Cloud Code access Objects -
in query, how can access object in parse
class? set object awayteam
equal newawayteam
object?
something like
closegametime.set("awayteam", "the newawayteam object");
original code
parse.cloud.job("closegametime", function(request, response) { parse.cloud.usemasterkey(); var query = new parse.query("score"); query.first({ success: function(closegametime) { var newawayteamvar = request.object.get("newawayteam"); closegametime.set("isgametime", "no"); closegametime.set("awayteam", newawayteamvar); closegametime.save(null, { success: function(closegametime) { response.success("successfully updated server."); }, error: function(closegametime, error) { response.error("could not save changes server."); } }); }, error: function(error) { response.error("could not find object."); } }); });
shouldn't hard. i've done similar on parse cloud code give shot:
var awayteamobject = request.object.get("newawayteam"); closegametime.set("awayteam", awayteamobject);
Comments
Post a Comment