1
我有以下火力地堡数据结构:如何更新/添加项目到Firebase中的JSON数组?
"Group" : {
"34923493" : {
"Name" : "Group 1"
"Users" : {
joeshmoe : true
janedoe : true
}
etc.....
}
}
欲以下添加到“用户”部分:
johndoe : true
当用户已经加入该组。我有以下代码
self.ref.child("Group").child(groupID!).child("Users").setValue([user?.username : true])
,但我得到了以下错误:
"Contextual type'Any' cannot be used with dictionary literal"
我不知道我的做错了吗?