1

Is there a solution for this in CloudKit JS? I have not been able to write a successful query to even get the ID of a Record.

The question in this link was here before, it is related if you'd like to take a look.

How to query for Metadata in CloudKit JS?

Community
  • 1
  • 1
SamYoungNY
  • 5,716
  • 4
  • 22
  • 36

1 Answers1

2

In CloudKit, the recordName is a Record's unique identifier. You can specify one yourself when creating a record or not specify it and let the server create a UUID for you. When fetching one or more records, you can access it via the recordName property.

You could have an auto-incrementing id if you specified the recordName yourself, but that would be quite cumbersome to manage for a system with distributed clients. It's likely that you'll instead want to allow the server to create the recordName UUID for you. You could then query the records and sort by creation date if you wanted to know the order in which they were created.

Dave Browning
  • 1,126
  • 6
  • 5