gpt4 book ai didi

firebase - 添加到特定文档的 map 字段(Flutter Firestore)

转载 作者:行者123 更新时间:2023-12-03 03:22:47 25 4
gpt4 key购买 nike

我正在使用flutter firestore,只想将用户(使用userInfo映射)添加(而不添加任何其他字段)到我的PrayerRooms集合中的特定文档中。我不确定如何执行此操作以及The database I want to add into是否可能

最佳答案

如果您还有其他字段,并且只想在保留其他字段的同时向userInfo映射添加数据,则可以使用updateData():

 Firestore.instance.collection("PrayersRoom").document(userId).updateData({
"userInfo.userId" : userId,
"userInfo.userCount" : 2
});

关于firebase - 添加到特定文档的 map 字段(Flutter Firestore),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61413264/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com