var r = base.getData("", { orderBy:"code", equalTo: code });
Assuming there are entries with the codes below, instead of valid results, I am getting these ...
var code = "12345"; // no results
var code = "03456"; // Error: Constraint index field must be a JSON primitive
The issue comes from line 249:
if (isNaN(optQueryParameters[key]) && typeof optQueryParameters[key] !== 'boolean') {
Because in both cases the function isNaN() returns false, considering both codes as numbers (that's how isNaN works as I understand), so it won't add the "" around the string value
But in this case the code values are strings with only digits, that can also have leading zeros
Is there a way to fix / workaround this situation?
Thanks in advance
Fausto
p.s.
I did a dirty hack to make it work, but not sure if it's the right approach
I am using your FirebaseApp library as follow:
var r = base.getData("", { orderBy:"code", equalTo: code });
Assuming there are entries with the codes below, instead of valid results, I am getting these ...The issue comes from line 249:
if (isNaN(optQueryParameters[key]) && typeof optQueryParameters[key] !== 'boolean') {
Because in both cases the function isNaN() returns false, considering both codes as numbers (that's how isNaN works as I understand), so it won't add the "" around the string valueBut in this case the code values are strings with only digits, that can also have leading zeros
Is there a way to fix / workaround this situation?
Thanks in advance Fausto
p.s. I did a dirty hack to make it work, but not sure if it's the right approach
I just redefined isNaN as follow:
and it's working that way