I am trying to get my mongo query to perform a partial and case insensitive match. I am currently doing this
bson.M{"$regex": primitive.Regex{Pattern: regexp.QuoteMeta(school), Options: "i"}
school is of type interface so I am getting this error -
interface
Cannot use school (variable of type interface{}) as string value in argument to regexp.QuoteMeta
How do I fix this?
2.1m questions
2.1m answers
60 comments
57.0k users