Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the number of records that match a CloudKit query

Using CloudKit on iOS, is it possible to determine the number of records that a particular query matches?

I'm not actually interested in reading the records themselves, I simply want to know how many records are matched by a query. I'm aware that matched records are returned in batches, so in principle I could obtain each batch of records, and calculate the total number of records by summing the number in each batch. However, the number of matched records will likely be large for this application, and given I'm not interested in the actual record content, this seems inefficient and wasteful.

Thanks in advance.

like image 300
Chris Avatar asked Feb 18 '15 18:02

Chris


1 Answers

There are no aggregation functions in CloudKit. The only way to do a count is by fetching all records.

like image 102
Edwin Vermeer Avatar answered Nov 06 '22 12:11

Edwin Vermeer