BuildShipBBuildShip
Powered by
syraxidlemindS
BuildShip•2y ago•
7 replies
syraxidlemind

Firebase filter condition = document reference in another collection

I'm struggling with a basic Firebase Collection Query filter. I have a collection, 'chapters', each of which has a 'book_id' field which stores a reference to the book document they belong to. When I want to query for all chapters with a particular book_id, I get empty results. If I omit the filter, all chapters are returned. Please help me understand what is wrong with this filter syntax:
[{"field": "book_id", "operator": "==", "value": "/books/someIdValue"}]
Solution
@syraxidlemind - you are correct, passing the reference as string wont work because you need to convert it to a valid firestore reference to be able to use it in a filter. If you copy this workflow and paste it, then the collection query node being used here will convert strings such as "users/user123" to a valid firestore ref and the filtering should work.
message.txt8.15KB
Jump to solution
BuildShip banner
BuildShipJoin
Join founders, builders, devs using Low-code / No-code to create backend, APIs, scheduled Jobs, automation, AI workflows
7,971Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Save document reference in another document.
o_mt.Oo_mt. / ❓・buildship-help
3y ago
How to set document reference in Firebase Node
Md RashedMMd Rashed / ❓・buildship-help
2y ago
Firebase Collection Problems
!CarlYouKilledIt!!CarlYouKilledIt / ❓・buildship-help
2y ago
get firebase collection data
JipprJJippr / ❓・buildship-help
2y ago