【发布时间】:2020-03-25 15:35:27
【问题描述】:
我是编码新手,我想要实现的是设置一种方法来检查帖子中的“星期一”集合以及数据是否存在?字段的值会更新,否则它们会被创建!我已经被困了一段时间,并被重定向到不同的解决方案,但没有任何东西对我有用。感谢所有帮助
Future<void> createPostMonday(Post post) async{
await postsRef.document(post.authorId).collection('Monday').setData({
'alOne':post.alOne,
'alTwo':post.alTwo,
'alThree':post.alThree,
'alFour':post.alFour,
'alFive':post.alFive,
'alSix':post.alSix,
'beOne':post.beOne,
'beTwo':post.beTwo,
'beThree':post.beThree,
'beFour':post.beFour,
'beFive':post.beFive,
'beSix':post.beSix,
'likes': post.likes,
'authorId': post.authorId,
'timestamp': post.timestamp,
});
【问题讨论】:
标签: flutter google-cloud-firestore