golang - upper.io/db/mongo是否支持正则表达式查询?
漂亮男人
漂亮男人 2017-05-02 09:17:44
0
1
596

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()

然而并不能进行正则匹配

漂亮男人
漂亮男人

répondre à tous(1)
漂亮男人

Pourquoi y a-t-il un deux-points $regex après votre : ?

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!