redlibets
redlibets9mo ago

Firestore multi-document filtering

Hi, Im new to Buildship and JavaScript and trying to retrieve the set of Firestore documents in a collection for which a field is equal to a certain value (e.g. return the list of cars for which speed = 10). This is step 1, the ultimate goal is to return the value of field A for the document where field B = X and field C = Y, maybe there is a better way? I can connect to the database etc fine and have succesfully tested pulling down a field value for the node which just gets one document, but when using the node which get mltiple ones I can't figure out what to put in the FIlters and Sort inputs to get it to run for this use case. I've tried various idea but usually end up getting the message: "orderBy.forEach is not a function" Any help greatly appreicated thanks 🙂
3 Replies
redlibets
redlibets9mo ago
I managed to get this to work using [{"field":"speed","operator":"=","value":10}] in the filter box
Gaurav Chadha
Gaurav Chadha9mo ago
Perfect. 🚀
Carl Maier
Carl Maier9mo ago
Hello, I am backend developer.