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?
1.4m articles
1.4m replys
5 comments
57.0k users