MongoConfig
1.28 KB
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
1. downlaod and install mongoDB from "https://www.mongodb.com/download-center#community".
2. create a folder mongoadmin somewhere in your D:\
3. create 3 folders within this folder with the following names:
conf
data
log
4. Place mongod.conf file in conf folder. Contents of file are below.
storage:
dbPath: "d:/mongoadmin/data"
journal:
enabled: true
systemLog:
destination: file
path: "d:/mongoadmin/log/mongod.log"
net:
http:
enabled: true
5. run command to install mongodb as windows service and in that command give the mongod.conf file's path as a parameter.
'mongod.exe --config "d:\mongoadmin\conf\mongod.conf" --install'
mong if you do not install mongodb as a service, then you need to run mongod.exe everytime you want to have mongodb running
6. after executing the above command, you can run the following command to start MongoDB service
"net start MongoDB"
to execute all the above commands, you need to open command with "run as administrator"
-------------
@TO DUMP DATABASE
mongodump -d <dataabseNme> -o <target diectory>
@TO RESTORE DB
mongorestore --db <database_name> <path_to_bson_file>
--------
@Install MongoBooster
and add DB name in create connection Default Database tab.