I'm performing query operation with Cloudkit, my record type is like this:
CKRecord Type: Person
{
name STRING,
age INTEGER,
friends ARRAY,
}
Now, I want to query all person with no friends.I have tried
NSPredicate *predicate = [[NSPredicate alloc] initWithFormat: @"friends[SIZE] == 0"];
CKQuery *query = [[CKQuery alloc] initWithPredicate: predicate];
And
NSPredicate *predicate = [[NSPredicate alloc] initWithFormat: @"friends.@count == 0"];
CKQuery *query = [[CKQuery alloc] initWithPredicate: predicate];
The first one crashed with warning
friends[SIZE] is not an evaluated object expression
and second one returning error of
Invalid predicate
So , what is the correct way to query with array size?