【发布时间】:2020-05-25 17:28:37
【问题描述】:
假设我有一个类 User 和一个类 Profile
配置文件类有一个名为“sex”的字段和一个名为“user”的字段,它是一个指向用户类的指针。
如果我通过https://myapi.back4app.io/classes/Profile 获得配置文件端点,我可以获得配置文件对象:
{
"results": [
{
"objectId": "sIE6lOZP7R",
"user": {
"__type": "Pointer",
"className": "_User",
"objectId": "asP3EFYSR4"
},
"sex": "male",
"createdAt": "2020-05-25T17:15:49.324Z",
"updatedAt": "2020-05-25T17:15:49.324Z"
}
]
}
如果我想包含此个人资料的用户,我可以包含:https://myapi.back4app.io/classes/Perfil?include=user 所以我得到:
{
"results": [
{
"objectId": "sIE6lOZP7R",
"user": {
"objectId": "asP3EFYSR4",
"username": "fabiojansen",
"createdAt": "2020-05-25T17:15:16.273Z",
"updatedAt": "2020-05-25T17:15:16.273Z",
"ACL": {
"*": {
"read": true
},
"asP3EFYSR4": {
"read": true,
"write": true
}
},
"__type": "Object",
"className": "_User"
},
"sex": "male",
"createdAt": "2020-05-25T17:15:49.324Z",
"updatedAt": "2020-05-25T17:15:49.324Z"
}
]
}
没关系,但如果我想在一个查询中获取所有用户的个人资料信息?这是可能的?在我的 User 类中,我没有任何指向 Profile 类的指针,只有在 Profile 类中。
有什么办法吗?
谢谢
【问题讨论】:
标签: parse-platform parse-server