Run aggregation pipeline and sort results by a set of match priorities

That is very surprising because in principal pipelines and queries are sent over and and run by the server. Yes, in principal, the driver in some occasion modify the query. For example, the short-cut query

{ a : 1 , b : 2 }

might be sent as

{ '$and': [ { a: { '$eq': 1 } }, { b: { '$eq': 2 } } ] }

But it is still possible that the driver has something to do with it.

That is the beauty of the concept of a pipeline, you may add stages to simplify followings. I often do that as it also helps debugging as you may set fields that are kept so you may find where things fails. So yes you may try to evaluated $regexMatch in a separate stage. Since I am not very go fluent, try this js version:

{ "$set" : {
    "_regex_match" : {
        "input" : "$name" ,
        "regex" : "\\bRonald\\b ,
        "options" : "i"
    }
} }

Then in your $cond of the next stage you simply use $_regex_match as the expression.

In case, you did not notice, I used 2 backslashes as it is needed in Java and JS. I do not know about go.