【发布时间】:2021-04-09 17:05:16
【问题描述】:
我正在尝试在 Firestore 地图字段中连接一个快速字典
//users is the collection and watched is the map field in firestore that I want to update with the dictionary {stringA : stringB}
db.collection("users").document(self.userID).updateData(["watched": {stringA:stringB}])
我想补充一点,在将字典添加到数组字段时它对我有用。但是,它确实存在重复和易于引用的问题。由于 Firestore 有一个地图类型字段,我想知道是否有任何方法可以直接将 swift 字典连接为键值对,如第二张图片所示(手动完成)。
【问题讨论】:
标签: swift firebase dictionary google-cloud-firestore swiftui