When I filter by userID (string field) and condition type is “equal” the results are as expected.
When I filter by itemID (number field) and condition type is “equal”, “Get Record Collection” fails with the following error: “TypeError: n.toLowerCase is not a function”.
The error is returned even if the number in the filter is static instead of using a dynamic variable
If I change the data type of of itemID from number to string in Firestore and Appgyver the search will work as expected but this is obviously a hack and should be avoided if possible.
To filter a number field in a Firestore document until Appgyver fix the bug and without compromising your data structure one can use the following technique…
In this case params.id contains the number I need to filter itemID by (itemID “equal” params.id). Instead of a “equal” condition (which currently fails) I use 2 conditions, “greater” than params.id - 1 and “less” than params.id + 1. Silly but it works.
If I use OP’s data structure, how will the read count from Firebase be like?
Let’s say if I have 100 documents from different users, 5 of those contain a userID called “exampleUserID”.
Using Appgyver’s “filter condition” to get documents that contain “exampleUserID”, does it have to read through all 100 documents (i.e. 100 read counts), or just 5 read counts?