Fix Firestore Error: A Document Must Have an Even Number of Path Elements
· 5 min read
If you are working with Firebase and suddenly see the error fatal: A document must have an even number of path elements, don't worry-you haven't broken your database. This is Firestore's way of telling you that you've gotten lost in the "Map" of your data.
In Firestore, there is one unbreakable rule: Collections and Documents must always alternate.
