4

I'm doing some work with mongodb and Regex.

So, I have run:

{
   "email": /@/
}

Now I want to say:

{
   "email": does not contain @
}

any help would be appreciated

4

1 回答 1

13
  • 使用{email: /^[^@]*$/}.
  • 或使用{email: {$not: /@/}}.
于 2013-01-22T18:08:27.963 回答