Home > Database > Mysql Tutorial > MongoDB插入查询数据(二), 条件查询

MongoDB插入查询数据(二), 条件查询

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:56:31
Original
1017 people have browsed it

db.things.find({name:"mongo" }).forEach(printjson);{ "_id" : ObjectId("501c7e5cab2f3c46faf8e68a"), "name" : "mongo" } 相当于 SELECT * FROM things WHERE . 里指定元素的名字 SELECT name FROM things WHERE db.things.find({name:"mongo"}, {name:

> db.things.find({name:"mongo"}).forEach(printjson); { "_id" : ObjectId("501c7e5cab2f3c46faf8e68a"), "name" : "mongo" }

相当于SELECT * FROM things WHERE

…”.

 

里指定元素的名字

 

SELECT name FROM things WHERE

 

> db.things.find({name:"mongo"}, {name:true}).forEach(printjson); { "_id" : ObjectId("501c7e5cab2f3c46faf8e68a"), "name" : "mongo" }

 

方法.

> db.things.find().limit(2); { "_id" : ObjectId("501c7e5cab2f3c46faf8e68a"), "name" : "mongo" } { "_id" : ObjectId("501c7e65ab2f3c46faf8e68b"), "x" : 3 }

 

 

 

,香港虚拟主机,网站空间,服务器空间
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