1
imxieke 2016-04-05 11:57:27 +08:00
正则表达式应该可以
|
2
SlipStupig OP @imxieke 具体怎么写呢?
|
3
imxieke 2016-04-05 16:31:41 +08:00
@SlipStupig 抱歉 没有使用过 Mongodb 不是很清楚
|
4
bwangel 2016-04-05 17:17:55 +08:00 1
```
> db.user.find() { "_id" : ObjectId("56d7ced2a2aed7154cef7b03"), "email" : "[email protected]", "first_name" : "Ross", "last_name" : "Lawley" } { "_id" : ObjectId("56d7d730a2aed7160b3f06c8"), "email" : "content", "first_name" : "xu", "last_name" : "yundong" } > db.user.find({'email': {$regex: '^(.*@.*)$'}}) { "_id" : ObjectId("56d7ced2a2aed7154cef7b03"), "email" : "[email protected]", "first_name" : "Ross", "last_name" : "Lawley" } ``` 这个是使用正则,匹配 @符号 |