Strange Firebase error

Hi there,

I’m attempting to update a value to a new firebase collection, which as far as I can see is using the same setup as a previous component (but to a different collection) - however it’s returning this error :

FirebaseError: Invalid collection reference. Collection references must have an odd number of segments, but scenecontrol/3qu2IgfMmq0kQ2Ifk0fK has 2

I can’t see any obvious error, and I’m not wholly sure what it means by ‘odd number of segments’…

Am I missing something really obvious?

Hi, the error is related to ‘scenecontrol/3qu2IgfMmq0kQ2Ifk0fK’ path. If you want to add to a collection the path shouldn’t have document id as the last component. Here’s some documentation which explains the ‘odd number of segments’ issue:

“Notice the alternating pattern of collections and documents. Your collections and documents must always follow this pattern. You cannot reference a collection in a collection or a document in a document.”