Specifying --dbpath seem to have no effect

29 views
Skip to first unread message

John

unread,
Dec 23, 2015, 4:04:36 PM12/23/15
to mongodb-user
Hi

I have MongoDB 2.6 installed on my computer. When I start mongod.exe with dbpath "\folderA" and insert some documents, then stop mongodb and start it again with dbpath "\folderB", I find the same documents in there when I query it. I'm a missing some basic point here?

Thanks
John


Stephen Steneker

unread,
Dec 24, 2015, 12:24:59 AM12/24/15
to mongodb-user

On Thursday, 24 December 2015 08:04:36 UTC+11, John wrote:

I have MongoDB 2.6 installed on my computer. When I start mongod.exe with dbpath "\folderA" and insert some documents, then stop mongodb and start it again with dbpath "\folderB", I find the same documents in there when I query it. I'm a missing some basic point here?

Hi John,

When you start mongod with --dbpath, this determines the directory used for database files. If you start mongod with different dbpath values there shouldn’t be any data shared between the two invocations.

How are you stopping mongod? Are you certain there isn’t another running instance of mongod that you are connecting to?

FYI, you can check the current dbPath in the mongo shell (if changed from the default) using: db.serverCmdLineOpts().parsed.storage.dbPath.

Regards,
Stephen

Reply all
Reply to author
Forward
0 new messages