Do you have any messages (errors) in the Developers console?
Are you sure that the collection has entries that match the query?
I tried my own experiment just to be sure. I received 7 as the count in my collection. I set the text field like this:
$w("#text22").text = num;
Howerver, the variable num is a Javascript number which results in this error:
To fix the error, modify your code to force the variable to be converted to a string:
$w("#text22").text = "" + num;
I hope this helps,
Yisrael
