title: CloudKit, join or efficient way to add an item to list
body: <p>I'm using CloudKit to manage a list of messages (record type Message with a field title and body). All messages are public and I want to maintain which Message the user has read using the mobile app. </p>
  
  <p>The app can have thousands of users and messages. And I use swift3. </p>
  
  <p>I've think of different way to do it but they seems quite poor in term of performance:</p>
  
  <ul>
  <li>add a field 'readers' to Message which is a list of string corresponding of user Id. The problem is that if I want to add a new user ID I must load all the list. This is problematic for a mobile app in case of a lot of users have read the message. Can I lazy fetch a list field and add a value to it without downloading all the list (like in classic Orm)?</li>
  <li>add another record type 'Reader' which has two fields: a user ID and a message ID. I can't find a way to join Message and Reader in a predicate to download only Message that the user hasn't read. Is that possible?</li>
  <li><a href="https://stackoverflow.com/a/39780343/231456">As suggested by Matthew</a>: add a record type ReadArticle in the private database that stores only a CKReference to a message. The problem is that we need to download all message ID before sending them in a NOT predicate.</li>
  </ul>
  
  <p>I don't know how to solve this problem with a database like CloudKit. </p>
  
  <p>Any advice ?</p>