0

I am trying to query the user class to find a user whose objectId I pass from my app to Cloud Code. I keep getting this error when I try to deploy my code to Parse:

Uncaught SyntaxError: Unexpected token ILLEGAL in main.js:4

Can someone let me know what I am doing wrong?

Parse.Cloud.define("followerCount", function(request, response) {
    var userQuery = new Parse.Query(Parse.User);
    userQuery.equalTo(“objectId”, request.params.objectId);
    var query = new Parse.Query("Friends");
    query.equalTo("toUser", userQuery);
    query.count({
        success: function(count) {
            response.success(count);
        },
        error: function() {
            response.error("count failed");
        }
    });
});
M. Schena
  • 2,039
  • 1
  • 21
  • 29
Trey R
  • 21
  • 1
  • 5
  • Possible duplicate of [Parse Cloud Code retrieving a user with objectId](http://stackoverflow.com/questions/26286919/parse-cloud-code-retrieving-a-user-with-objectid) – Noam Hacker Jan 27 '16 at 17:17
  • Please refer to this: [http://stackoverflow.com/questions/26286919/parse-cloud-code-retrieving-a-user-with-objectid?noredirect=1&lq=1](http://stackoverflow.com/questions/26286919/parse-cloud-code-retrieving-a-user-with-objectid?noredirect=1&lq=1) – Paradise Nov 09 '16 at 08:48

1 Answers1

0

You're using the wrong kind of quotes here: “objectId”.

Replace them with the correct quotes: "objectId"

Mike Cluck
  • 31,869
  • 13
  • 80
  • 91
  • the correct quotes did allow it to deploy to Parse. Thank you! But I get an error when it tries to run the cloud code response. Any suggestions? – Trey R Jan 28 '16 at 00:09
  • this is the error i received. [Error]: undefined (Code: 141, Version: 1.11.0) – Trey R Jan 28 '16 at 04:17
  • @TreyR [A quick Googling](http://parse.com/docs/dotnet/api/html/T_Parse_ParseException_ErrorCode.htm) shows that it means a script failed. I've never used Parse so I couldn't tell you why. – Mike Cluck Jan 28 '16 at 15:36