如何使用Parse Rest API返回总对象的计数?

Jos*_*eph 0 parse-platform

我正在使用Parse Rest API,我想获得对象总数的计数.我尝试通过传入count = 1参数在命令行上使用curl命令,如下所示:

curl -X GET
    -H "X-Parse-Application-Id: <App ID Here>"
    -H "X-Parse-REST-API-Key: <Rest Key Here>"
    https://api.parse.com/1/classes/Restaurant
    --data-urlencode 'count=0'
Run Code Online (Sandbox Code Playgroud)

但我得到了所有结果.在这可能与Parse.com或我将不得不使用代码并指望客户端代码?

Blu*_*ety 5

如果您不想获得所有结果,您可以添加限制参数,如下所示:

curl -X GET
    -H "X-Parse-Application-Id: <App ID Here>"
    -H "X-Parse-REST-API-Key: <Rest Key Here>"
    https://api.parse.com/1/classes/Restaurant
    --data-urlencode 'count=1'
    --data-urlencode 'limit=0'
Run Code Online (Sandbox Code Playgroud)

资料来源:https://parse.com/docs/rest#queries-counting