mongo数据库的常见操作

连接mongodb数据库的命令查看对应数据库
mongo.exe
use shujukuming;
db.opportunity.findOne({"id":5});

db.opportunity.findOne();

db.facultype.drop();
db.institute.drop();
db.node.drop();

db.opportunity.drop();
db.program.drop();
db.user.drop();

db.userweb.drop();

"title_pic" : "./upload/product/logo/2016-01-09/thumb/1452323575_4478803
86.jpg"

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:UsersAdministrator>d:

D:>cd D:developsoftwareMongoDBin

D:developsoftwareMongoDBin>net start MongoDB
MongoDB 服务正在启动 .
MongoDB 服务已经启动成功。


D:developsoftwareMongoDBin>mongo.exe
2016-01-09T11:12:44.498+0800 I CONTROL [main] Hotfix KB2731284 or later update
is not installed, will zero-out data files
MongoDB shell version: 3.2.0
connecting to: test
> use shujukuming;
switched to db shujukuming
> db.opportunity.findOne({"id":5});
{
"_id" : ObjectId("5645576c916891242b28318c"),
"id" : 5,
"institute_id" : 300,
"institute" : "University of Wisconsin–?Madison",
"tinstitute" : "威斯康星大学-麦迪逊",
"title" : "Visiting International Student Program",
"type" : 1,
"level" : 4,
"url" : "http://continuingstudies.wisc.edu/visp/index.html",
"introduce" : "Experience UW-Madison student life! The Visiting Interna
ional Student Program (VISP) offers you an opportunity to become an official UW
Madison student and to take regular university courses with our world-class fac
lty. ",
"benefit" : "1.you may join clubs, use libraries, computer and sports a
d facilities, and have full access to all student support services. <br> 2.you
will leave UW-Madison with the knowledge you gained and an official transcript
f the work you completed on our campus. <br> 3.Your academic work at UW-Madiso
may transfer toward your degree program at home or to a degree program in the
uture. <br> 4.you’ll be invited to participate in and join activities sponsor
d by the Wisconsin Alumni Association (WAA) international network of over 400,0
0 students worldwide.<br> 5.The Madison Experience :peaceful places to study a
d explore while experiencing the beauty of our city.",
"to_who" : "",
"apply_fee" : "",
"cost" : "$ 22,305 Fall or Spring (4 Months)<br> $46,353 Academic Year
(9 Months)<br> $ 5,614 4-Week Session (1 Month)<br> $11,178 8-Week Session (2
Months)",
"cost_url" : "http://continuingstudies.wisc.edu/visp/financial-requirem
nts.htm",
"attention" : "",
"apply_url" : "https://uwmadison.qualtrics.com/SE/?SID=SV_0HTPAaHgHK45d
o",
"deadline" : "Fall : May 1<br> Spring : September 1<br> Summer (Diff
rent sessions offered between May - August) : February 1",
"requirement" : "TOEFL: Minimum of 80 for Internet (iBT) and 550 for pa
er test or 213 (computer-based) <br> IELTS: Minimum of 6.5<br> GPA:3.0<br> S
anned copy of official college transcripts <br> Scanned copy of passport infor
ation page<br> Scanned copy of your financial support documents ",
"term" : "Fall Semester (September - December)<br> Spring Semester (Ja
uary - May) <br> Summer (Different sessions offered between May - August)",
"apply_process_url" : "http://continuingstudies.wisc.edu/visp/applyvisp
htm"
}
> db.opportunity.findOne({"id":5});
{
"_id" : ObjectId("5645576c916891242b28318c"),
"id" : 5,
"institute_id" : 300,
"institute" : "University of Wisconsin–?Madison",
"tinstitute" : "威斯康星大学-麦迪逊",
"title" : "Visiting International Student Program",
"type" : 1,
"level" : 4,
"url" : "http://continuingstudies.wisc.edu/visp/index.html",
"introduce" : "Experience UW-Madison student life! The Visiting Interna
ional Student Program (VISP) offers you an opportunity to become an official UW
Madison student and to take regular university courses with our world-class fac
lty. ",
"benefit" : "1.you may join clubs, use libraries, computer and sports a
d facilities, and have full access to all student support services. <br> 2.you
will leave UW-Madison with the knowledge you gained and an official transcript
f the work you completed on our campus. <br> 3.Your academic work at UW-Madiso
may transfer toward your degree program at home or to a degree program in the
uture. <br> 4.you’ll be invited to participate in and join activities sponsor
d by the Wisconsin Alumni Association (WAA) international network of over 400,0
0 students worldwide.<br> 5.The Madison Experience :peaceful places to study a
d explore while experiencing the beauty of our city.",
"to_who" : "",
"apply_fee" : "",
"cost" : "$ 22,305 Fall or Spring (4 Months)<br> $46,353 Academic Year
(9 Months)<br> $ 5,614 4-Week Session (1 Month)<br> $11,178 8-Week Session (2
Months)",
"cost_url" : "http://continuingstudies.wisc.edu/visp/financial-requirem
nts.htm",
"attention" : "",
"apply_url" : "https://uwmadison.qualtrics.com/SE/?SID=SV_0HTPAaHgHK45d
o",
"deadline" : "Fall : May 1<br> Spring : September 1<br> Summer (Diff
rent sessions offered between May - August) : February 1",
"requirement" : "TOEFL: Minimum of 80 for Internet (iBT) and 550 for pa
er test or 213 (computer-based) <br> IELTS: Minimum of 6.5<br> GPA:3.0<br> S
anned copy of official college transcripts <br> Scanned copy of passport infor
ation page<br> Scanned copy of your financial support documents ",
"term" : "Fall Semester (September - December)<br> Spring Semester (Ja
uary - May) <br> Summer (Different sessions offered between May - August)",
"apply_process_url" : "http://continuingstudies.wisc.edu/visp/applyvisp
htm"
}
>

 ----------------------------------------------------------

连接mongodb数据库的命令查看对应数据库
mongo.exe
use shujukuming;
db.opportunity.findOne({"id":5});

db.opportunity.findOne();

db.facultype.drop();
db.institute.drop();
db.node.drop();

db.opportunity.drop();
db.program.drop();
db.user.drop();

db.userweb.drop();

"title_pic" : "./upload/product/logo/2016-01-09/thumb/1452323575_4478803
86.jpg"

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:UsersAdministrator>d:

D:>cd D:developsoftwareMongoDBin

D:developsoftwareMongoDBin>net start MongoDB
MongoDB 服务正在启动 .
MongoDB 服务已经启动成功。


D:developsoftwareMongoDBin>mongo.exe
2016-01-09T11:12:44.498+0800 I CONTROL [main] Hotfix KB2731284 or later update
is not installed, will zero-out data files
MongoDB shell version: 3.2.0
connecting to: test
> use shujukuming;
switched to db shujukuming
> db.opportunity.findOne({"id":5});

> db.opportunity.findOne({"id":5});

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:UsersAdministrator>d:

D:>cd D:developsoftwareMongoDBin

D:developsoftwareMongoDBin>net start MongoDB
MongoDB 服务正在启动 .
MongoDB 服务已经启动成功。


D:developsoftwareMongoDBin>mongo.exe
2016-01-09T11:12:44.498+0800 I CONTROL [main] Hotfix KB2731284 or later update
is not installed, will zero-out data files
MongoDB shell version: 3.2.0
connecting to: test
> use shujukuming;
switched to db shujukuming
> db.opportunity.findOne({"id":5});
{
"_id" : ObjectId("5645576c916891242b28318c"),
"id" : 5,
"institute_id" : 300,
"institute" : "University of Wisconsin–?Madison",
"tinstitute" : "威斯康星大学-麦迪逊",
"title" : "Visiting International Student Program",
"type" : 1,
"level" : 4,
"url" : "http://continuingstudies.wisc.edu/visp/index.html",
"introduce" : "Experience UW-Madison student life! The Visiting Internat
ional Student Program (VISP) offers you an opportunity to become an official UW-
Madison student and to take regular university courses with our world-class facu
lty. ",
"benefit" : "1.you may join clubs, use libraries, computer and sports an
d facilities, and have full access to all student support services. <br> 2.you
will leave UW-Madison with the knowledge you gained and an official transcript o
f the work you completed on our campus. <br> 3.Your academic work at UW-Madison
may transfer toward your degree program at home or to a degree program in the f
uture. <br> 4.you’ll be invited to participate in and join activities sponsore
d by the Wisconsin Alumni Association (WAA) international network of over 400,00
0 students worldwide.<br> 5.The Madison Experience :peaceful places to study an
d explore while experiencing the beauty of our city.",
"to_who" : "",
"apply_fee" : "",
"cost" : "$ 22,305 Fall or Spring (4 Months)<br> $46,353 Academic Year
(9 Months)<br> $ 5,614 4-Week Session (1 Month)<br> $11,178 8-Week Session (2
Months)",
"cost_url" : "http://continuingstudies.wisc.edu/visp/financial-requireme
nts.htm",
"attention" : "",
"apply_url" : "https://uwmadison.qualtrics.com/SE/?SID=SV_0HTPAaHgHK45dU
o",
"deadline" : "Fall : May 1<br> Spring : September 1<br> Summer (Diffe
rent sessions offered between May - August) : February 1",
"requirement" : "TOEFL: Minimum of 80 for Internet (iBT) and 550 for pap
er test or 213 (computer-based) <br> IELTS: Minimum of 6.5<br> GPA:3.0<br> Sc
anned copy of official college transcripts <br> Scanned copy of passport inform
ation page<br> Scanned copy of your financial support documents ",
"term" : "Fall Semester (September - December)<br> Spring Semester (Jan
uary - May) <br> Summer (Different sessions offered between May - August)",
"apply_process_url" : "http://continuingstudies.wisc.edu/visp/applyvisp.
htm"
}
> db.opportunity.findOne({"id":5});
{
"_id" : ObjectId("5645576c916891242b28318c"),
"id" : 5,
"institute_id" : 300,
"institute" : "University of Wisconsin–?Madison",
"tinstitute" : "威斯康星大学-麦迪逊",
"title" : "Visiting International Student Program",
"type" : 1,
"level" : 4,
"url" : "http://continuingstudies.wisc.edu/visp/index.html",
"introduce" : "Experience UW-Madison student life! The Visiting Internat
ional Student Program (VISP) offers you an opportunity to become an official UW-
Madison student and to take regular university courses with our world-class facu
lty. ",
"benefit" : "1.you may join clubs, use libraries, computer and sports an
d facilities, and have full access to all student support services. <br> 2.you
will leave UW-Madison with the knowledge you gained and an official transcript o
f the work you completed on our campus. <br> 3.Your academic work at UW-Madison
may transfer toward your degree program at home or to a degree program in the f
uture. <br> 4.you’ll be invited to participate in and join activities sponsore
d by the Wisconsin Alumni Association (WAA) international network of over 400,00
0 students worldwide.<br> 5.The Madison Experience :peaceful places to study an
d explore while experiencing the beauty of our city.",
"to_who" : "",
"apply_fee" : "",
"cost" : "$ 22,305 Fall or Spring (4 Months)<br> $46,353 Academic Year
(9 Months)<br> $ 5,614 4-Week Session (1 Month)<br> $11,178 8-Week Session (2
Months)",
"cost_url" : "http://continuingstudies.wisc.edu/visp/financial-requireme
nts.htm",
"attention" : "",
"apply_url" : "https://uwmadison.qualtrics.com/SE/?SID=SV_0HTPAaHgHK45dU
o",
"deadline" : "Fall : May 1<br> Spring : September 1<br> Summer (Diffe
rent sessions offered between May - August) : February 1",
"requirement" : "TOEFL: Minimum of 80 for Internet (iBT) and 550 for pap
er test or 213 (computer-based) <br> IELTS: Minimum of 6.5<br> GPA:3.0<br> Sc
anned copy of official college transcripts <br> Scanned copy of passport inform
ation page<br> Scanned copy of your financial support documents ",
"term" : "Fall Semester (September - December)<br> Spring Semester (Jan
uary - May) <br> Summer (Different sessions offered between May - August)",
"apply_process_url" : "http://continuingstudies.wisc.edu/visp/applyvisp.
htm"
}
>

原文地址:https://www.cnblogs.com/sengling/p/5155374.html