I have a DB collection "X", where there is a column "C" of the type "array". I'm reading the value in the column "C" by indexing it with _id and "where" query service.
The result I am getting back is correct (debugged using an alert). This is what I get returned (each array element is a code):
["834cd", "dke9rwe", "dii94", "ckdi9e"]
...this is exactly what is stored in the DB cell of concern, so this is right!
Now, I want to calculate the length of these value. So what I do is first store the result from Query response into local variable called arrLSV (by mapping the response to it). Then, to form a formatted string I'v defined a Javascript called formattedJSV to which a string from response is matched. Since I wanted to display this string with array length post-pended, I've tried to do the following in the "add JS" for "formattedJSV":
var arr = localStorage.getItem("arrLSV");
var str = value + " total: " + arr.length;
Appery("someFormattedLabel").text(str);
This is not working. I get null returned back as size. When I try to print things out due to debug, the arrLSV prints out fine until I don't add the arr.length code. When arr.length code is added I started getting weired results (sometimes not consistent with the last time).
How can I calculate the arrLSV's length properly????