dynamoDB无法插入新项目

时间:2017-11-27 08:03:57

标签: swift amazon-dynamodb

我目前正在使用DynamoDB。我发现我无法将新项添加到数据库表中。它只是将新信息填充到存储在数据库表中的一个现有对象。这是代码

let customer: Customers = Customers()

customer._userId = AWSIdentityManager.default().identityId!
customer._firstName = "Chen1"
customer._lastName = "DSA"
customer._address = ["A303,Sa 41-45 Belmore st,ryde"]
customer._email = ["chenhoaSasanglei3215@gmail.com"]
customer._mobile = ["04246saSa41108"]
customer._chineseIDNumber = ["4405saSasaS20195013"]
customer._fullName = "H"

//Save a new item
dynamoDbObjectMapper.save(customer).continueWith(block: { (task:AWSTask<AnyObject>!) -> Any? in
    if let error = task.error as? NSError {
        print("The request failed. Error: \(error)")
    } else {
        print("item saved",task)
    }
    return nil
})

0 个答案:

没有答案