Location of the mongodb database on mac

后端 未结 6 1216
离开以前
离开以前 2021-01-29 17:37

I am kind of new to mac as well as mongodb.

I have a weird doubt, accessing the database created using mongodb on mac?

I know, in windows there is a folder calle

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-29 18:05

    The default data directory for MongoDB is /data/db.

    This can be overridden by a dbpath option specified on the command line or in a configuration file.

    If you install MongoDB via a package manager such as Homebrew or MacPorts these installs typically create a default data directory other than /data/db and set the dbpath in a configuration file.

    If a dbpath was provided to mongod on startup you can check the value in the mongo shell:

    db.serverCmdLineOpts()
    

    You would see a value like:

    "parsed" : {
        "dbpath" : "/usr/local/data"
    },
    

提交回复
热议问题