首页 > upper.io/db/mongo是否支持正则表达式查询?

upper.io/db/mongo是否支持正则表达式查询?

RT
https://godoc.org/upper.io/db/mongo 提供了个find函数,然而我想进行模糊匹配。func (self *Collection) Find(terms ...interface{}) db.Result
试图通过下列方法传参

temp := map[string]string{
                        "$regex:":  ".*",
                    }
count, _ := col.Find(db.Cond{"url": temp}).Count()

然而并不能进行正则匹配


为什么你的 $regex 后面还有个 : 冒号?

【热门文章】
【热门文章】