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

Hi @George_Kamel ,

I think latest compass aggregation tab have an “Export to Language” for Go. Also maybe the beta has also advanced language syntax :slight_smile:

It recommends me to use:

bson.D{
                        {"$regexMatch",
                            bson.D{
                                {"input", "$name"},
                                {"regex", primitive.Regex{Pattern: "ron"}},
                                {"options", "i"},
                            },
                        },
                    },

Have you tried the compass syntax?

Thanks
Pavel