iOS - Realm Query is not working properly
<p>I am using Swift(2.2) Realm Framework as doing with document. Here is my codes.</p>

<pre><code>class SwipedAsset: Object{
   dynamic var identifier = ""
   dynamic var createdAt = ""
}

// save data
let realm = try! Realm()
let fileName = asset.originalFilename
if fileName != nil {
   let swipedAssets = realm.objects(SwipedAsset.self).filter("identifier == '\(fileName!)'")
   let assetCount = swipedAssets.count
   if assetCount == 0 {
       let swipedAsset = SwipedAsset()
       if asset.originalFilename != nil {
             swipedAsset.identifier = asset.originalFilename!
       }
       if asset.creationDate != nil {
          let year = String(asset.creationDate!.year)[2...3]
          let key = "\(asset.creationDate!.monthName) \(year)"
                    swipedAsset.createdAt = key
                }

       let realm = try! Realm()

       try! realm.write{
           realm.add(swipedAsset)
           }
       }

 }

 // load data 
 let realm = try! Realm()
 let swipedAssets = realm.objects(SwipedAsset.self).filter("createdAt == '\(key)'")
 let lastObject = swipedAssets.last
 print(lastObject.identifier)
 print(lastObject.createdAt)
</code></pre>

<p>Here, values are all "", "" Nothing, But swipedAssets.count = 3  I thought it means realm's query is working properly.
What's wrong with me ? Thanks for any help.</p>