0

We wrote the parse cloud function to update the object .

Until today morning it was working fine. Now our cloud code is not working . can you please check this ?

Below is our code to update the object which is throwing error

var point = new query(); for this line we are getting error like

TypeError: undefined is not a function

below is our full code

     var query = Parse.Object.extend("Merchants");
     var point = new query(); 
     point.id = request.params.id;
     point.set("keyfield1",request.params.keyfield1);
     point.set("keyfield2",request.params.keyfield2);
     point.set("keyfield3",request.params.keyfield3);
     point.set("keyfield4",request.params.keyfield4);
     point.set("keyfield5",request.params.keyfield5);
     point.save(null,{
     success:function(response)
     {
             var resp={};
             resp.ResponseCode = "1000";
             resp.data = response;
             response.success(resp);
     },
     error:function(response)
     {
         response.error(response.status);
     }
     });

Can you please help us with this issue.

venkatesh
  • 164
  • 1
  • 13
  • You want the point truly from query or without query? Its a custom class in code but you name it a query. – eth3lbert Jan 27 '15 at 13:50

1 Answers1

0

Try this:

var Merchants = Parse.Object.extend("Merchants");
var merchantQuery = new Parse.Query(Merchants);
merchantQuery.equalTo("<someKey>", <someVal>);
merchantQuery.find().then(...);

Hope it helps

Luca Iaco
  • 3,387
  • 1
  • 19
  • 20