go-mongo-driver 正则匹配要填写不带斜杠内容

2023-02-01

var reg = "hello"

collection.Find(ctx, bson.D{{Key: "keyword", Value: primitive.Regex{Pattern: reg, Options: ""}}})

Pattern内填写不携带斜杠的内容