↧
Answer by Đăng Khoa Đinh for $or Operator in Mongoose
I think the problem is because you wrap the regular expression in ``, which is understood as a string. You can try this way:const queryWordRegex = new RegExp(body.queryWord, "i");const query = {$or: [...
View Article$or Operator in Mongoose
I am using the $or operator in mongoose for searching through the name and description fields of the database. I want to check if the queryWord string contains any part of the database field(s). This...
View Article