[英]Invalid document reference
Firestore.firestore().collection("users").document(model.id).setData(["owningRoom" : newRoom])
I'm calling this in Swift 4 with Firestore. 我在Firestore中使用Swift 4来调用它。 I want to set the data of a document in collection "users". 我想在集合“users”中设置文档的数据。 It gives me the following error: 它给了我以下错误:
Invalid document reference. Document references must have an even number of segments, but users has 1
How come? 怎么会? I call the collection first, then the document, hence 2 segments? 我首先调用集合,然后是文档,因此是2段?
My bad. 我的错。 The variable model.id was empty, that's why it only had 1 segment. 变量model.id是空的,这就是为什么它只有1段。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.