Hey guys, I need help on the MongoDB - store data in MongoDB Ex 1 in C9.
I did Step 9 ‘npm install learnyoumongo -g’ fine, and saw the installation included mongoDB 2.2.8 installation. Then came the trouble :
Step 10 says install mongoDB, but the video clip says mondoDB already installed in C9 workspace, just need to create a file named solution.js, then type the command “mongod --version”. I followed that and got the following error:
audt:~/workspace $ mongod --version
bash: mongod: command not found
I decided to give Step 11 set up mongod alias a try by following the directions at https://community.c9.io/t/setting-up-mongodb/1717
audt:~/workspace $ mkdir data
audt:~/workspace $ echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$@"' > mongod
audt:~/workspace $ chmod a+x mongod
This is what my workspace looks like after running the above alias setup:
audt:~/workspace $ ls -lrF
total 28
-rw-r--r-- 1 ubuntu ubuntu 0 Jun 11 01:24 solution.js
-rw-r--r-- 1 ubuntu ubuntu 1931 Feb 20 02:33 server.js
-rw-r--r-- 1 ubuntu ubuntu 376 Feb 20 02:33 package.json
drwxr-xr-x 6 ubuntu ubuntu 4096 Feb 20 02:57 node_modules/
-rwxr-xr-x 1 ubuntu ubuntu 59 Jun 11 01:36 mongod*
drwxr-xr-x 2 ubuntu ubuntu 4096 Jun 11 01:35 data/
drwxr-xr-x 8 ubuntu ubuntu 4096 Feb 20 02:57 client/
-rw-r--r-- 1 ubuntu ubuntu 1001 Feb 20 02:33 README.md
audt:~/workspace $ cat mongod
mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$@"
Step 13 says “Whenever you run a command that includes mongod on c9.io, use ./mongod instead.”. However, when I tried to run ./monod, I got this
audt:~/workspace $ ./mongod
./mongod: line 1: mongod: command not found
I am really confused, do I need to run Step 10 to install mongoDB in my C9 workspace or not ? If not, what am I missing that mongod is not recognized ?