It only works as a system user.
If I select “Application Authentication” I get (Location17313) $match with $text is only allowed as the first pipeline stage.
Please help, I can’t run this query as a system user!
edit: I can even imagine how it happens: Realm probably inserts some conditions to enforce privileges and it upsets $text.
I just realised that a resolver’s response is being filtered according to rules even when it’s running as System, so it solves the problem for me!
Though would have been nice to update the docs and mention this problem.