草庐IT

scanMonth

全部标签

mongodb - 如何执行不区分大小写的 $in $regex 数组?

我如何使用$in通过mongoose搜索mongodb数据库运算符$regex使用数组操作,例如["/servers/i","/redhat/i"].我想找到类似的东西Report.find({scanMonth:{$in:result},os:{$in:REGEXARRAY},'ipscanMonthoscrit',function(err,results)我的问题是 最佳答案 您需要将这些条件与$and和$or结合起来,例如:Report.find({$and:[{scanMonth:{$in:result}},{$or:[{o