解析查询,其中键包含数组中的任何对象

Parse query where key contains any object in array

我的解析 class 有一个名为 "postcodes" 的属性,它是一个数字数组。

在我的应用程序中,我有一个 "relevantPostcodes" 数组。我想创建一个查询,其中邮政编码键包含 "relevantPostcodes" 数组中的任何对象。

类似于 [query whereKey:@"postcodes" containsAnyObjectInArray:relevantPostcodes"]。有什么想法吗?

您可以使用 [query whereKey:@"postcodes" containedIn:relevantPostcodes]。参见description in the doc。就像 equal to 方法一样,我认为它会操作数组类型的属性并做你需要的。