0

我想使用属性更新名为 type[USERS] 的图形实体中的信息:但是在搜索后更新特定实体时,它被重复了。谢谢

let existElement = graph.searchForEntity(properties: [(key: "username", value: username),("id", id)])


if existElement.count == 1 {

          existElement[0]["id"] = id
          existElement[0]["username"] = username
          existElement[0]["password"] = password
          existElement[0]["nome"] = nome
          existElement[0]["data_cerazione"] = NSDate()

            // salviamoIlDatabase
            graph.async() { (success: Bool, error: NSError?) in
                if let e = error { // se c'è un errore...
                    print(e.localizedDescription) // lo stampiamo in console
                }
            }
    }
4

0 回答 0