I'm getting this error of "request contains more than the maximum number of items in a single request (400)" when trying to save a batch of records (Mainly Route Locations) using CloudKit CKModifyRecordsOperation. If I save only a few 100 records then it works just fine. Is there a batch size/array limitation when saving reords in cloudkit?
CloudKit Error: 'Request contains more than the maximum number of items in a single request (400)' when saving a big batch of records.
Yes there are limits to some operations and you appear to have hit one. When I was building our latest I ran into this as well. I put in a queue to hold our records being processed. If the queue reached a certain amount then I branched off to post the changes and returned to the process after that. CloudKit being asynchronous means that they wind up being sent off in chunks when there's time. In my case I ran into a different limit. I mgiht have been adding new records at the time, the reported limit was 250, whereas yours appears to be 400 (reported in the parens). You also can't request records matching a certain key with more than 250 items listed in the predicate (using CKQueryOperation). At the time I remember being quite peeved that I was unable to find the limits in any of the documentation.
HTH,
Mike