$indexOfCP returns only one occurance

I’m using $indexOfCP for locating the index of some specific words. I’ve just noticed that $indexOfCP is case sensitive and I want it to be insensitive.
plus, it only returns the first result. I want all the occurrences.
Thanks for your help.

As in most languages, for efficiency reasons, strings comparisons are case-sensitive.

You may achieve case insensitive comparisons by converting both argument to the same case with https://docs.mongodb.com/manual/reference/operator/aggregation/toLower/ and https://docs.mongodb.com/manual/reference/operator/aggregation/toUpper/.