IjzerenHein / firestorter

Use Google Firestore in React with zero effort, using MobX 🤘
http://firestorter.com
MIT License
378 stars 50 forks source link

Unable to set Document path directly with new Document() #5

Closed wirelessed closed 6 years ago

wirelessed commented 6 years ago

Hi I think the new Document() function is not working correctly. When I try const myDoc = new Document("users/" + userid + "/docs/" + docid);

This error appears: Uncaught (in promise) Error: Invalid collection reference. Collection references must have an odd number of segments, but <myfilename> has 4

However, when I try the following, it works perfectly. const myDoc = new Document(); myDoc.path = "users/" + userid + "/docs/" + docid;

IjzerenHein commented 6 years ago

Huh, that is weird indeed. I'm gonna have a look whether I can reproduce it 👍

IjzerenHein commented 6 years ago

Hi, after inspection I'm pretty sure this issue has already been fixed. It is fixed in v0.8.1, please upgrade to the latest version.

wirelessed commented 6 years ago

great! thank you!