gpt4 book ai didi

javascript - 解析: Include nested pointers in query

转载 作者:行者123 更新时间:2023-12-03 03:35:43 24 4
gpt4 key购买 nike

我的应用程序具有以下结构:

MessageRecipients -> Message -> User 
Message -> Activity

其中 -> 表示指针。我已将消息和消息收件人表分开,因为我需要捕获每个收件人是否已阅读该消息。

我想要执行的查询是查找收件人的所有邮件。因此,我需要在 MessageRecipients 查询中包含消息,但我还想包含嵌套的 User 和 Activity 对象。

var MessageRecipient = new Parse.Query('MessageRecipient');
messageQuery.equalTo('recipient', query.recipient);
messageQuery.include('message');

消息返回时未填充事件和发件人。我尝试调用 messageQuery.include('activity') 但这不起作用,因为 Activity 不在正确的表上。

有没有办法执行此查询,或者是否必须对嵌套对象执行单独的查询?

最佳答案

您还需要包含这些子子对象:

messageQuery.include('message');
messageQuery.include('message.user'); // if user is the column name
messageQuery.include('message.activity'); // if activity is the column name

关于javascript - 解析: Include nested pointers in query,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24515784/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com