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
I am requesting an update to the wiki for doing a query of a subcollection. It looks like some work has been done to make this possible, but it was very difficult to find after digging through the addon files to discover these features exist. It would be a shame for a user with less experience to not understand or discover these features just because it wasn't listed on the wiki.
The features I am talking about is the FirestoreQuery.sub_collection_path property which allows a string to nest the collection query to a sub path.
The other feature which is required is in the FirestoreQuery.from('collection',false) to override the default allDescendants=true because otherwise the query will cause an error regarding indexes for collection groups. I'm sure someone could change the indexes for these but that doesn't seem practical with the dynamic nature of the creation of subcollections.
I am not an expert engineer, but these were my experiences below that are a direct copy/paste from the Discord just for context. I am not trying to cause more work but rather pointing out that this work was already done and it would be a shame for a newer user to miss out on them.
Thank you again to everyone who has made this addon possible!
My Discord Ramblings Below:
grimberet : I cannot figure out how to query a sub collection. I don't see it in the docs, can anyone point me in the right direction?
grimberet: Okay, after digging through the code, I seem to have found where I can assign query().sub_collection_path = 'rootCollection/documentid123'
However I get an error if I do query.where('someNotEmptyField',FirestoreQuery.OPERATOR.NOT_EQUAL,''), because { "code": 400, "message": "collection group queries are only allowed at the root parent", "status": "INVALID_ARGUMENT" }
I'm not doing a group query am I? I am only querying one sub collection
grimberet : Okay, after printing my query to string I noticed the allDescendants that defaults to true. I switched that to false and it seems to have fixed everything. None of this was easy to find and I am super appreciative for the hard work, but this kind of stuff would be really helpful in the wiki
I can tell that a lot of hard work was done to make sure these options exist, so please let me know if I could help with adding these options to the wiki ... not sure I am experienced enough or what but I hate making recommendations if I am not willing to help out, which I am...
The text was updated successfully, but these errors were encountered:
I am requesting an update to the wiki for doing a query of a subcollection. It looks like some work has been done to make this possible, but it was very difficult to find after digging through the addon files to discover these features exist. It would be a shame for a user with less experience to not understand or discover these features just because it wasn't listed on the wiki.
The features I am talking about is the FirestoreQuery.sub_collection_path property which allows a string to nest the collection query to a sub path.
The other feature which is required is in the FirestoreQuery.from('collection',false) to override the default allDescendants=true because otherwise the query will cause an error regarding indexes for collection groups. I'm sure someone could change the indexes for these but that doesn't seem practical with the dynamic nature of the creation of subcollections.
I am not an expert engineer, but these were my experiences below that are a direct copy/paste from the Discord just for context. I am not trying to cause more work but rather pointing out that this work was already done and it would be a shame for a newer user to miss out on them.
Thank you again to everyone who has made this addon possible!
My Discord Ramblings Below:
grimberet : I cannot figure out how to query a sub collection. I don't see it in the docs, can anyone point me in the right direction?
grimberet: Okay, after digging through the code, I seem to have found where I can assign query().sub_collection_path = 'rootCollection/documentid123'
However I get an error if I do query.where('someNotEmptyField',FirestoreQuery.OPERATOR.NOT_EQUAL,''), because { "code": 400, "message": "collection group queries are only allowed at the root parent", "status": "INVALID_ARGUMENT" }
I'm not doing a group query am I? I am only querying one sub collection
grimberet : Okay, after printing my query to string I noticed the allDescendants that defaults to true. I switched that to false and it seems to have fixed everything. None of this was easy to find and I am super appreciative for the hard work, but this kind of stuff would be really helpful in the wiki
I can tell that a lot of hard work was done to make sure these options exist, so please let me know if I could help with adding these options to the wiki ... not sure I am experienced enough or what but I hate making recommendations if I am not willing to help out, which I am...
The text was updated successfully, but these errors were encountered: