CloudKit Query does not work

When query, no record returned:

but using fetch, can see the record, while in a strange status: "Record not found"

Answered by DTS Engineer in 789419022

@marknote The UI is indeed a bit confusing, but your second screenshot shows that no record was found (even though it says "1 item"), which is the same as what your first screenshot shows.

If you do have records in the database, do a full query, pick one from the result set, use the value of its recordName field to query or fetch, as @edorphy suggested, CloudKit Console should return you the record.

If you do confirm that a full query returns the record, but using recordName to query or fetch doesn't, I'd suggest that you file a feedback report with all the details for the CloudKit Console team to investigate.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

This doesn't look right, are you customizing your recordName when creating objects? What are you using to generate your identifier?

The recordName is typically in the form of a UUID if you leave things alone and let the system generate identifiers for you.

Can you just do a full query of that PNote type in your development container, see your record, click on it, and copy paste that identifier exactly as is into the screenshots you've provided?

I've reported issues with console UI for queries and such in the past and gotten a few fixes, perhaps there is something invalid about having a period in your recordName? That having been said however, I haven't come across any documentation describing limitations.

@marknote The UI is indeed a bit confusing, but your second screenshot shows that no record was found (even though it says "1 item"), which is the same as what your first screenshot shows.

If you do have records in the database, do a full query, pick one from the result set, use the value of its recordName field to query or fetch, as @edorphy suggested, CloudKit Console should return you the record.

If you do confirm that a full query returns the record, but using recordName to query or fetch doesn't, I'd suggest that you file a feedback report with all the details for the CloudKit Console team to investigate.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Now fetch just return internal error:

Hitting an internal error indicates that something is wrong on the server side. You can switch to the Logs view to see if there is anything interesting there. Also, if the data and schema in your container don't matter, try to use the "Reset Environment..." button on the side bar to do a reset.

If the issue is still there, since you don't have control on CloudKit Console, I guess you can only file a feedback report for the CloudKit folks to investigate. Meanwhile, you can create a new container to continue your development, if appropriate.

CloudKit Query does not work
 
 
Q