Unable to print Count of Entries using substr or hasPrefix

Sir, first, thank you so much for this - I would try out tomorrow as it is almost 12 am here at my place.

If I get your correctly on that quoted text, and there is no type, then, if functions could not be applied to the left side of a where clause, the following from this URL - Finding Count on a set of files with specific Front Matter - #6 by Sids - works. I would be thankful if you could help me understand the difference.

{{ $section := where site.Pages "Section" "fruits"}}
	<p>Number of Red Fruits:
		{{ len (where $section "Params.fruitcolor" "==" "red") }}</p>