title: RealmSwift : All the realm rows are displayed twice
body: <p>I am learning to develop on Swift, so sorry if my questions seem stupid :D
  On my app, I need 3 objects : Car, Station &amp; Conso
  A Car Object can have many Conso
  A Station Object car have many Conso
  A Conso Object can be linked to only one Car and one Station</p>
  
  <p>Here are the codes for Realm objects </p>
  
  <p>Conso.swift</p>
  
  <pre><code>import Foundation
  import RealmSwift
  
  final class Conso : Object {
  
     //var id: Int
     @objc dynamic var idConso = ""
     //... Some fields
  
     @objc dynamic var data: NSData?
     @objc dynamic var idCar = "" 
     @objc dynamic var station: Station?  // Link to a Station Object
     @objc dynamic var car: Car?  // Link to a car Object
  </code></pre>
  
  <p>Car.swift</p>
  
  <pre><code>import Foundation
  import RealmSwift
  
  final class Car : Object {
  
  //@objc dynamic var ID = 0
  @objc dynamic var idCar = ""
  //...some fields
  @objc dynamic var data: NSData?
  
  // Link to Conso object (Many-to-One)
  let consos = LinkingObjects(fromType: Conso.self, property: "car")
  </code></pre>
  
  <p>Station.swift</p>
  
  <pre><code>import Foundation
  import RealmSwift
  import MapKit
  
  final class Station : Object {
  
  //@objc dynamic var ID = 0
  @objc dynamic var idStation = ""
  //...some fields
  @objc dynamic var data: NSData?
  // Link to Conso object (Many-to-One)
  let consos = LinkingObjects(fromType: Conso.self, property: "station")
  </code></pre>
  
  <p>I insert the objects on database using this snippet :</p>
  
  <pre><code>// Create a Conso Object
  let conso:Conso = Conso()
  conso.idConso = "Conso-123454344"
  
  if let textStationService = self.TextFieldStationService.text{
              conso.nomStation = textStationService
              conso.station?.nomStation = textStationService
  }
  
  if let textCPStationService = self.TextFieldCodePostal.text{
              conso.CPStation = textCPStationService
              self.station!.codePostal = textCPStationService
          }
  
  if let textVilleStationService = self.TextFieldStationServiceCPVille.text{
              conso.villeStation = textVilleStationService
              self.station!.ville = textVilleStationService
          }
  
  // A car object is received from another viewController
  conso.car = self.car 
  
  let realm = try! Realm()
  try! realm.write {
    realm.add(conso)
    realm.add(station!)
  }
  </code></pre>
  
  <p>From another ViewController, I get the results with this snippet
  assumed that a car id (idCar) is received from another VC :</p>
  
  <pre><code>func listConso(){
      let realm = try! Realm()
      // Get the car from its id
      self.car = realm.objects(Car.self).filter("idCar = %@",self.idCar).first
      // Get Conso based on the searched car
      self.consosData = realm.objects(Car.self).filter("idCar = %@",self.idCar).first?.consos.sorted(byKeyPath: "dateConso", ascending: false)
      self.consos = Array((self.consosData)!)
  
  
      self.tableViewConso.setEditing(false, animated: true)
      self.tableViewConso.reloadData()
      print("listConsop")
  }
  </code></pre>
  
  <p>The result is that I have many lines twice</p>
  
  <p>Thank you for your help.</p>