I want to change the directory of MongoDb. I tried using mongod --dbpath and also changing the path of directory in mongod.conf. Follwing are commands I used -
mongod --dbpath /home/mongodata
and
dbpath = /home/mongodata
in /etc/mongod.conf
chown $USER -R /home/mongodata
But when I import data into database, it still goes to /var/lib/mongodb folder.
Please can anyone suggest how I can change the default directory of mongodb database?
I use Ubuntu 14.04 and MongoDb vz 3.0.6.