title: Realm + Swift update object with JSON string
body: <p>I am using the alamofire to get response JSON from server, then using ObjectMapper to map string to Realm object. </p>
  
  <pre><code>    The realm object is:
      class SolutionVideo: Object, Mappable {
  
  dynamic var svID = 0
  dynamic var solutionTitle = ""
  dynamic var videoName = ""
  dynamic var relatedInfo = ""
  dynamic var shortDesc = ""
  
  override static func primaryKey() -&gt; String? {
      return "svID"
  }
  
  required convenience init?(_ map: Map) {
      self.init()
  }
  
  func mapping(map: Map) {
      svID &lt;- map["svID"]
      solutionTitle &lt;- map["solutionTitle"]
      videoName &lt;- map["videoName"]
      relatedInfo &lt;- map["relatedInfo"]
      shortDesc &lt;- map["shortDescription"]
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>    The json string is:
      [
      {
          "svID": "10",
          "solutionTitle": "Video10",
          "videoName": "Video10",
          "realtedInfo": "",
          "shortDescription": ""
      },
      {
          "svID": "9",
          "solutionTitle": "Video9",
          "videoName": "Video9",
          "realtedInfo": "",
          "shortDescription": ""
      }
       ]
  
  
  
       in my viewController:
           @IBAction func updateBtn(sender: AnyObject) {
      // download file to update Realm
      let url = "http://janicedemo.com/updates.json"
      Alamofire.request(.GET, url).responseArray { (response: Response&lt;[SolutionVideo], NSError&gt;) in
          let Array = response.result.value
          print(Array)
          if let Array = Array {
              for video in Array {
                  let dbURL = Realm.Configuration.defaultConfiguration.fileURL
                  let realm = try! Realm(fileURL: dbURL!)
                  try! realm.write{
                      print("will save")
                      realm.add(video, update: true)
                  }
              }
          }
      }
  </code></pre>
  
  <p>The problem is that I can add the object successfully. But the svID(primark key) keeps 0, instead of 10 or 9 (set in JSON). Is it because I have set default value to svID? Can someone gives me a hint? Thanks</p>