Home > Database > Mysql Tutorial > mongodb奇怪模糊查询问题

mongodb奇怪模糊查询问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:56:44
Original
1060 people have browsed it

db.keke.insert({name:"hky"}); db.keke.find() { "_id" : ObjectId("50222ec21905597a6291d35c"), "name" : "hky" } db.keke.find({"name":{$regex:'hk'}}); { "_id" : ObjectId("50222ec21905597a6291d35c"), "name" : "hky" } 但是 db.keke.find({name:/h

db.keke.insert({name:"hky"});

db.keke.find()
{ "_id" : ObjectId("50222ec21905597a6291d35c"), "name" : "hky" }

db.keke.find({"name":{$regex:'hk'}});

{ "_id" : ObjectId("50222ec21905597a6291d35c"), "name" : "hky" }

但是

db.keke.find({name:/hk/});

就返回空,虚拟主机,美国空间,很多资料都说可以用db.keke.find({name:/hk/});方式模糊查询啊,美国服务器,为什么我的不行?

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template