You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When attempting to fetch documents from a collection using the firestore.collection("/collection+a/lF1kvtRAYMqmdInT7iJK/subcollection").get() the snapshot always returns snapshot.docs.length as 0 if the provided path contains a + character.
To Reproduce
Created 2 identical collection hierarchies:
/collection+a/lF1kvtRAYMqmdInT7iJK/subcollection
/collectiona/lF1kvtRAYMqmdInT7iJK/subcollection
Both contain a single document (again with the same id sTPO9C0HbZJUlKcm1QwR for control)
I spent some time on this today and want to add a little more debugging information on this for anyone referring this.
When + character is present in the path, especially when used with sub collections it is treated a s space character (), ie., /collection+a/abc/subcol is treated as /collection a/abc/subcol. Which pretty much seems like a encoding issue.
Which in turn means:
This works fine as intended, outputs Number of documents: 1 (or the number of documents correctly)
final snapshot =await db.collection("collection+a").get();
print('Number of documents: ${snapshot.docs.length}');
Setting up a collection & document like "collection a/abc/subcol/xyz" and running:
final snapshot =await db.collection("collection+a/abc/subcol").get();
print('Number of documents: ${snapshot.docs.length}');
Interestingly outputs, Number of documents: 1
@rrousselGit, just CC-ing you, I'll try to dig in further, if you have any leads on this please let me know, thanks :)
Which pretty much looks same. Apart from that, there's two specific headers NodeJS library add, google-cloud-resource-prefix and x-goog-request-params, that we don't. Anyway, that also doesn't seems be causing the issue.
Describe the bug
When attempting to fetch documents from a collection using the
firestore.collection("/collection+a/lF1kvtRAYMqmdInT7iJK/subcollection").get()
the snapshot always returnssnapshot.docs.length
as 0 if the provided path contains a+
character.To Reproduce
Created 2 identical collection hierarchies:
Both contain a single document (again with the same id
sTPO9C0HbZJUlKcm1QwR
for control)Expected behavior
I would expect the
+
character to have no impact on returning a collection as it is a valid character for a collection path.The text was updated successfully, but these errors were encountered: