Using Mongoose, trying to query all records that do not contain a substring.
I have a User Schema, with an email field. I want get all user documents where the email field does not contain @testschool.edu . Reg Ex seems to be not working.
Tried this:
User.count()
.where({email: { "$regex": '^((?!testschoo.edu).)*$', "$options": "i" }})