-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.dbshell
99 lines (99 loc) · 2.41 KB
/
.dbshell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
db
show dbs
db.book.insert({"name": "MongoDB Tutorial", "author": "velopert"});
show dbs
use mongodb_tutorial
db.dropDatabase();
use test
db.createCollection("books")
db.createCollection("articles", { capped: true, autoIndex: true, size: 6142800, max: 10000 })
db.people.insert({"name": "velopert"})
show collections
show dbs
db.books.insert({"name": "NodeJS Guide", "author": "Veloport"})
db.books.insert([ {"name": "Book1", "author": "Veloport"}, {"name": "Book2", "author": "Velopert"} ]};
db.books.insert([ {"name": "Book1", "author": "Veloport"}, {"name": "Book2", "author": "Velopert"} ]);
db.books.find();
quit
db.collections(0 sdfq );
db.collections();
db.collections.find();
show db
show collections
show dbs
use mongodb_tutorial
show mongodb_tutorial
show.connections
show.connetion
show collections
quit
show dbs
use main
db.createCollection(1)
db.createCollection("1")
db.deleteCollection("1")
db.1.drop()
db."1".drop()
show colections
show collections
db.1.drop()
db.1.drop();
use testdb
db.createCollection("user")
db.user.insert({"contactID": "123", "name": "Alice", "phoneNum": "010-2223-3322", "email": "[email protected]" })
db.user.find()
db.user.find().pretty()
db.createCollection("myGallaxy")
db.myGallaxy.insert([ {"contactID": "223", "name": "Betty", "phoneNum": "010-2233-1122", "email": "[email protected]" }, {"contactID": "11", "name": "Candy", "phoneNum": "010-2222-2222", "email": "[email protected]" }])
db.myGallaxy.find()
db.myGallaxy.find().pretty()
show dbs
show dbs
use testdb
show collections
db.myGallaxy.find()
db.myGallaxy.find().pretty()
show collections
show dbs
use mongodb_tutorial
show collections
use testdb
show collections
show dbs
use testdb
ls
show collections
db.collections.find(0 sdf a)
db.collections.find().pretty()
db.myGallaxy.find().pretty()
use
use testdb
db.createCollection(myGallaxy)
db.createCollection(myGallaxy);
ls
show collections
db.contacts.find().pretty()
use testdb
use testdb
ls
show collections
db.contacts.drop()
show collections
db.contacts.save({ "facebook_key": "krista", "contactID": "112", "name": "Is" , "phoneNum": "010-2233-2211", "email": "[email protected]" });
db.contacts.find().pretty()
use testdb
show collections
db.contacts.find().pretth()
db.contacts.find().pretty()
use testdb
db.contacts.find().pretty()
use testdb
db.contacts.drop()
show dbs
use testdb
show collections
db.photos.find();
db.photos.drop();
db.newCollection(photos)
use testdb
db.photos.find().pretty()