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:\Users\Administrator>d:

D:\>cd D:\developsoftware\MongoDB\bin

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


D:\developsoftware\MongoDB\bin>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>\n2.you
will leave UW-Madison with the knowledge you gained and an official transcript
f the work you completed on our campus. <br>\n3.Your academic work at UW-Madiso
may transfer toward your degree program at home or to a degree program in the
uture. <br>\n4.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>\n5.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>\n$46,353 Academic Year
(9 Months)<br>\n$ 5,614 4-Week Session (1 Month)<br>\n$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>\nSpring : September 1<br>\nSummer (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>\nIELTS: Minimum of 6.5<br>\nGPA:3.0<br>\nS
anned copy of official college transcripts <br>\nScanned copy of passport infor
ation page<br>\nScanned copy of your financial support documents\n\n",
"term" : "Fall Semester (September - December)<br>\nSpring Semester (Ja
uary - May) <br>\nSummer (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>\n2.you
will leave UW-Madison with the knowledge you gained and an official transcript
f the work you completed on our campus. <br>\n3.Your academic work at UW-Madiso
may transfer toward your degree program at home or to a degree program in the
uture. <br>\n4.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>\n5.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>\n$46,353 Academic Year
(9 Months)<br>\n$ 5,614 4-Week Session (1 Month)<br>\n$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>\nSpring : September 1<br>\nSummer (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>\nIELTS: Minimum of 6.5<br>\nGPA:3.0<br>\nS
anned copy of official college transcripts <br>\nScanned copy of passport infor
ation page<br>\nScanned copy of your financial support documents\n\n",
"term" : "Fall Semester (September - December)<br>\nSpring Semester (Ja
uary - May) <br>\nSummer (Different sessions offered between May - August)",
"apply_process_url" : "http://continuingstudies.wisc.edu/visp/applyvisp
htm"
}
>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

C:\Users\Administrator>d:

D:\>cd D:\developsoftware\MongoDB\bin

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


D:\developsoftware\MongoDB\bin>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>\n2.you
will leave UW-Madison with the knowledge you gained and an official transcript o
f the work you completed on our campus. <br>\n3.Your academic work at UW-Madison
may transfer toward your degree program at home or to a degree program in the f
uture. <br>\n4.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>\n5.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>\n$46,353 Academic Year
(9 Months)<br>\n$ 5,614 4-Week Session (1 Month)<br>\n$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>\nSpring : September 1<br>\nSummer (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>\nIELTS: Minimum of 6.5<br>\nGPA:3.0<br>\nSc
anned copy of official college transcripts <br>\nScanned copy of passport inform
ation page<br>\nScanned copy of your financial support documents\n\n",
"term" : "Fall Semester (September - December)<br>\nSpring Semester (Jan
uary - May) <br>\nSummer (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>\n2.you
will leave UW-Madison with the knowledge you gained and an official transcript o
f the work you completed on our campus. <br>\n3.Your academic work at UW-Madison
may transfer toward your degree program at home or to a degree program in the f
uture. <br>\n4.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>\n5.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>\n$46,353 Academic Year
(9 Months)<br>\n$ 5,614 4-Week Session (1 Month)<br>\n$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>\nSpring : September 1<br>\nSummer (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>\nIELTS: Minimum of 6.5<br>\nGPA:3.0<br>\nSc
anned copy of official college transcripts <br>\nScanned copy of passport inform
ation page<br>\nScanned copy of your financial support documents\n\n",
"term" : "Fall Semester (September - December)<br>\nSpring Semester (Jan
uary - May) <br>\nSummer (Different sessions offered between May - August)",
"apply_process_url" : "http://continuingstudies.wisc.edu/visp/applyvisp.
htm"
}
>

 

你可能感兴趣的:(mongo数据库的常见操作)