Firestore.firestore().collection("users").document(model.id).setData(["owningRoom" : newRoom])
I'm calling this in Swift 4 with Firestore. I want to set the data of a document in collection "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?
My bad. The variable model.id was empty, that's why it only had 1 segment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With