-
Notifications
You must be signed in to change notification settings - Fork 0
/
seed.txt
35 lines (19 loc) · 1.06 KB
/
seed.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
This steps is to import the database on ur device
1)get the path for mongodb in ur laptop
it should be sth like this "C:\Program Files\MongoDB\Server\4.2\bin"
2)open cmd
3) type cd "mongodb path" in the cmd
you should type sth like this cd "C:\Program Files\MongoDB\Server\4.2\bin"
4)type mongod in cmd
5)type mongo in cmd
6)type show dbs in cmd
7)type cd "mongodb path" in the cmd again
8)for importing json files in your data base
type mongoimport --jsonArray --db projectx --collection "name of the collection" --file "path for json file in you computer"
Note :path for your json file should end with the name of the json file it should be sth like this
D:\data\playlist.json
Example: if you will import the playlist.json file
(can find data folder in the root of the project)
mongoimport --jsonArray --db projectx --collection playlists --file D:\data\playlist.json
by now you should see message in cmd that the documents are imported successfully in data base
and if you are already opening the mongodb then close it and open again to see the change in it