0

I am new to mongodb
I have created two db paths with

mongod --dbpath abc 
mongod --dbpath xyz

when I checked the /usr/local/etc/mongod.conf file it still shows storage:

dbPath: 
  /usr/local/var/mongodb 

how I can tell mongo command to load db from abc or xyz directory? should I change mongod.conf file manually or is there any arguments that I can pass while mongo db server.

Mongodb version and details

$ mongod --version
db version v3.4.5
git version: 520b8f3092c48d934f0cd78ab5f40fe594f96863
OpenSSL version: OpenSSL 1.0.2l  25 May 2017
allocator: system
modules: none
build environment:
    distarch: x86_64
    target_arch: x86_64
Johnykutty
  • 12,091
  • 13
  • 59
  • 100
  • Specifically [this answer there](https://stackoverflow.com/a/35193212/2313887) which I know it says PC, but the concepts are all the same. Separate config files and different ports are required for more than one instance on the same machine. `--dbpath` does not "create". It tells the `mongod` process where to look for it's database files for that particular process instance. – Neil Lunn Jul 06 '17 at 05:35
  • thanks, let me give a try :) – Johnykutty Jul 06 '17 at 06:13

0 Answers0