使用db.RegExp进行模糊查找时,如何查找集合中object里面的内容?

发布于 7 年前作者 zouxia13355 次浏览最后编辑 7 年前来自 ask

想查找下图的内容,但是不知道要怎么操作

db.collection('readyToPub').where(_.or([
     {
       //下面这一句应该要怎么改?
       content:db.RegExp({
         regexp:theWords,  //要查找的字符
         options: 'i'
       })
     }
   ]))
1 回复
houxiulan
houxiulan1 楼5 年前

‘content.title’:db.RegExp({ regexp:theWords, options:‘i’ })