-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhow-to-mongo.txt
49 lines (32 loc) · 933 Bytes
/
how-to-mongo.txt
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
---------------------------------------------
// install mongoDB
//see: https://docs.mongodb.com/manual/
// make sure the mongo server is running before launching the app.
In a terminal type the following and leave it running:
mongod
// then to check things out
// in another terminal, the mongo shell:
mongo
// to show what databases exist
show dbs
// to select a database to use
use cyberstix
// to show what is in the database
show collections
// to create a collection
db.createCollection("bundles")
db.createCollection("userLog")
// to delete a collection
db.bundles.drop()
db.bundlesInfo.drop()
db.indicator.drop()
db.userLog.drop()
// to list what is in a collection
db.bundles.find().pretty()
db.bundlesInfo.find().pretty()
db.indicator.find().pretty()
db.indicator.find().pretty()
db.relationship.find().pretty()
// to delete a whole database
db.dropDatabase()
---------------------------------------------