-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMongodbcollection.txt
20 lines (12 loc) · 1.24 KB
/
Mongodbcollection.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
cmd-> mongod
show dbs
use liot
show collections
db.modules.insert([{Code:54,Title:'C',GPA:4},{Code:34,Title:'JAVA',GPA:3},{Code:43,Title:'PHP',GPA:4},{Code:54,Title:'SQL',GPA:3}, {Code:12,Title:'Mongo',GPA:2},{Code:23,Title:'HTML',GPA:1},{Code:42,Title:'XML',GPA:3}]);
db.lectures.insert([{ESSN:54,HallNO:65,Sssn:45,Module:123},{ESSN:34,HallNO:45,Sssn:65,Module:355},{ESSN:43,HallNO:63,Sssn:65,Module:783},{ESSN:54,HallNO:65,Sssn:34,Module:456}, {ESSN:12,HallNO:65,Sssn:12,Module:223},{ESSN:23,HallNO:34,Sssn:75,Module:243},{ESSN:42,HallNO:54,Sssn:98,Module:653}]);
db.tutes.insert([{ESSN:54,HallNO:65,Sssn:45,Module:123},{ESSN:34,HallNO:45,Sssn:65,Module:355},{ESSN:43,HallNO:63,Sssn:65,Module:783},{ESSN:54,HallNO:65,Sssn:34,Module:456}, {ESSN:12,HallNO:65,Sssn:12,Module:223},{ESSN:23,HallNO:34,Sssn:75,Module:243},{ESSN:42,HallNO:54,Sssn:98,Module:653}]);
db.labs.insert([{ESSN:34,HallNO:45,Sssn:65,Module:355},{ESSN:43,HallNO:63,Sssn:65,Module:783},{ESSN:54,HallNO:65,Sssn:34,Module:456}, {ESSN:12,HallNO:65,Sssn:12,Module:223},{ESSN:23,HallNO:34,Sssn:75,Module:243},{ESSN:42,HallNO:54,Sssn:98,Module:653}]);
> db.labs.insertOne({ESSN:54,HallNO:65,Sssn:45,Module:123});
db.modules.find().pretty()
db.studentcollection.find().pretty()
mongoexport