Ios 解析-xcode中的多条件查询问题(objective-c)

Ios 解析-xcode中的多条件查询问题(objective-c),ios,mysql,objective-c,xcode,parse-platform,Ios,Mysql,Objective C,Xcode,Parse Platform,我使用解析后端作为Xcode(objective-c)中应用程序的数据库,但我不知道如何编写多条件解析格式查询。我想将下面的查询转换为Xcode中的解析格式查询 $msg_record = $this->db->query('SELECT msg, send_id, send_time FROM msg_record WHERE (send_id=123456789 AND to_id=987654321) OR (send_id=98765

我使用解析后端作为Xcode(objective-c)中应用程序的数据库,但我不知道如何编写多条件解析格式查询。我想将下面的查询转换为Xcode中的解析格式查询

$msg_record = $this->db->query('SELECT msg, send_id, send_time FROM msg_record
                     WHERE (send_id=123456789 AND to_id=987654321) OR (send_id=987654321 AND to_id=123456789)
                     ORDER BY send_time ASC')->result();
有人能帮我转换查询吗?谢谢。

要在解析查询中创建or条件,您必须创建两个(或更多)子查询,并与
或queryWithSubQueries
合并。 请注意,您不能将
SELECT
直接从SQL转换为解析

这就是您正在寻找的:

PFQuery *query1 = [PFQuery queryWithClassName:@"msg_record"];
[query1 whereKey:@"send_id" equalTo:@"123456789"];
[query1 whereKey:@"to_id" equalTo:@"987654321"];

PFQuery *query2 = [PFQuery queryWithClassName:@"msg_record"];
[query2 whereKey:@"send_id" equalTo:@"987654321"];
[query2 whereKey:@"to_id" equalTo:@"123456789"];

PFQuery *mainQuery = [PFQuery orQueryWithSubqueries:@[query1,query2]];
[mainQuery orderByAscending:@"send_time"];

你有没有检查过,我已经读过了。我可以编写“WHERE send_id=123456789和to_id=987654321”解析查询,但我不知道如何使用OR编写两个大的条件语句。