简体   繁体   English

解析云代码用户查询错误

[英]Parse Cloud Code User Query Error

I am trying to query the user class to find a user whose objectId I pass from my app to Cloud Code. 我正在尝试查询用户类以查找其objectId从我的应用程序传递给Cloud Code的用户。 I keep getting this error when I try to deploy my code to Parse: 当我尝试将代码部署到Parse时,我一直收到此错误:

Uncaught SyntaxError: Unexpected token ILLEGAL in main.js:4 未捕获到的SyntaxError: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");
        }
    });
});

You're using the wrong kind of quotes here: “objectId” . 您在这里使用了错误的引号: “objectId”

Replace them with the correct quotes: "objectId" 用正确的引号替换它们: "objectId"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM