title: Cannot store lists - Realm Swift
body: <p>I am trying to create a one to many relationship between medication table and side effects table. <code>RealmObject</code> is a custom class created from <code>Object</code> class.</p>
  
  <p>Model definitions:</p>
  
  <pre><code>class Medication: RealmObject {
  
      @objc dynamic var name : String?
      @objc dynamic var form : String?
      @objc dynamic var id : String?
  
      let medToSideEffect = List&lt;SideEffect&gt;()
  
      override class func primaryKey() -&gt; String? {
          return "id"
      }
  }
  
  
  class SideEffect: RealmObject {
  
      @objc dynamic var masterSideEffectId : String = ""
      @objc dynamic var entityType : String = ""
      @objc dynamic var entityId : String = ""
      @objc dynamic var sideEffect : String = ""
      @objc dynamic var id : String = ""
      @objc dynamic var uniqueId : String = ""
  
      override class func primaryKey() -&gt; String? {
          return "uniqueId"
      }
  }
  </code></pre>
  
  <p>Test code:</p>
  
  <pre><code>let medicationItem = Medication(dict: medication)
  
  let sideEffectItems = List&lt;SideEffect&gt;()
  for sideEffect in sideEffectList {
      let sideEffectItem = SideEffect()
      sideEffectItem.id = self.getMongoId()
      sideEffectItem.entityType = "Medicine"
      sideEffectItem.entityId = medicationItem.id!
      sideEffectItem.sideEffect = (sideEffect as? String)!
      sideEffectItem.uniqueId = "\(medicationItem.id!)_\(((sideEffect as? NSString)?.replacingOccurrences(of: " ", with: "_"))!)"
  
      sideEffectItems.append(sideEffectItem)
      medicationItem.medToSideEffect.append(sideEffectItem)
  }
  </code></pre>
  
  <p>After this process, when i print the <code>medicationItem</code>,  Output is this</p>
  
  <pre><code>Medication {
      name = Paracetomol 650mg;
      form = tab;
      id = 5af96e79efb27f6bd5c25a66;
  }
  </code></pre>
  
  <p>The side effects were supposed to be added to the medication object. but that is not the case anymore. It was working fine until the latest update Realm 3.11.0. </p>
  
  <p>Please let me know, if the code is incorrect.</p>