How do i find my mongodb database?

Docs HomeMongoDB Manual

Every mongod instance has its own local database, which stores data used in the replication process, and other instance-specific data. The local database is invisible to replication: collections in the local database are not replicated.

local.startup_log

On startup, each mongod instance inserts a document into startup_log with diagnostic information about the mongod instance itself and host information. startup_log is a capped collection. This information is primarily useful for diagnostic purposes.

For example, the following is a prototype of a document from the startup_log collection:

{
"_id" : "",
"hostname" : "",
"startTime" : ISODate(""),
"startTimeLocal" : "",
"cmdLine" : {
"dbpath" : "",
" :
},
"pid" : ,
"buildinfo" : {
"version" : "",
"gitVersion" : "",
"sysInfo" : "",
"loaderFlags" : "",
"compilerFlags" : "",
"allocator" : "",
"versionArray" : [ , , <...> ],
"javascriptEngine" : "",
"bits" : ,
"debug" : ,
"maxBsonObjectSize" :
}
}

Documents in the startup_log collection contain the following fields:

local.startup_log._id

Includes the system hostname and a millisecond epoch value.

local.startup_log.hostname

The system's hostname.

local.startup_log.startTime

A UTC ISODate value that reflects when the server started.

local.startup_log.startTimeLocal

A string that reports the startTime in the system's local time zone.

local.startup_log.cmdLine

An embedded document that reports the mongod runtime options and their values.

local.startup_log.pid

The process identifier for this process.

local.startup_log.buildinfo

An embedded document that reports information about the build environment and settings used to compile this mongod. This is the same output as buildInfo. See buildInfo.

local.system.replset

local.system.replset holds the replica set's configuration object as its single document. To view the object's configuration information, issue rs.conf() from mongosh. You can also query this collection directly.

local.oplog.rs

local.oplog.rs is the capped collection that holds the oplog. You set its size at creation using the oplogSizeMB setting. To resize the oplog after replica set initiation, use the Change the Size of the Oplog procedure. For additional information, see the Oplog Size section.

Starting in MongoDB 4.0, the oplog can grow past its configured size limit to avoid deleting the majority commit point.

Starting in MongoDB 5.0, it is no longer possible to perform manual write operations to the oplog on a cluster running as a replica set. Performing write operations to the oplog when running as a standalone instance should only be done with guidance from MongoDB Support.

local.replset.minvalid

This contains an object used internally by replica sets to track replication status.

Multi-Document Transactions on localYou cannot perform read/write operations to the collections in the local database inside a multi-document transaction.Retryable Writes against local

You cannot perform write operations to collections in the local database with retryable writes enabled.

Important

The official MongoDB 4.2-series drivers enable retryable writes by default. Applications which write to the local database will encounter write errors upon upgrading to 4.2-series drivers unless retryable writes are explicitly disabled.

To disable retryable writes, specify retryWrites=false in the connection string for the MongoDB cluster.

Where is my MongoDB database located?

The default location for the MongoDB data directory is c:\data\db. So you need to create this folder using the Command Prompt. Execute the following command sequence. Then you need to specify set the dbpath to the created directory in mongod.exe.

How do I access MongoDB database?

To open up the MongoDB shell, run the mongo command from your server prompt. By default, the mongo command opens a shell connected to a locally-installed MongoDB instance running on port 27017 . Try running the mongo command with no additional parameters: mongo.