如何使用 REST API 通过指针查询对象?

Ram*_*ses 2 rest parse-platform

我在 parse.com 上托管了这个结构:

事件

  • 对象ID:String
  • 玩家ID:Pointer<Player>
  • 比赛编号:Pointer<Match>
  • 一些与问题无关的其他属性

匹配

  • 对象ID:String
  • 所有者 ID:String
  • 比赛日期:Date

我想使用 REST 检索与一场特定比赛相关的所有事件,但我使用的查询有问题。

这是我正在使用的查询(带有 HTTParty gem 的 ruby​​):

base_uri = "https://api.parse.com/1/classes"
endpoint = 'Event/?&include=matchId&where={"ownerId":"201"}'
app_id = "app_id"
rest_api_key = "api_key"
headers = {"X-Parse-Application-Id" => app_id, 
    "X-Parse-REST-API-Key" => rest_api_key, 
    "Content-Type" => "application/json"}

response = HTTParty.get(URI.encode("#{base_uri}/#{endpoint}"), headers: headers)
Run Code Online (Sandbox Code Playgroud)

Ram*_*ses 5

事实证明,它的完成方式与关系查询相同。这是工作查询:

endpoint = 'Event/?where={"matchId":{"$inQuery":{"where":{"ownerId":201},"className":"Match"}}}'
Run Code Online (Sandbox Code Playgroud)