Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-5432

Clarify "show dbs" behavior

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Server
    • Labels:
      None
    • Last comment by Customer:
      true
    • Story Points:
      0.5

      Description

      Documentation Changes

      • Make a note in reference/mongo-shell explaining that empty databases are not listed.
      • Explain that "use <db>" does not create a database.

      Behavior Summary

      Databases are created and exist after inserting the first document into a collection in the database. Databases and collections are created implicitly; however, creating a database or collection object in your client does not create a database or collection. use <db> does not create new database files.

      Empty databases are not listed in the output of show dbs. This is partially storage engine dependent. MMAPv1, it's impossible to have an extant but empty database: you cannot create a database except by inserting data. Even if you later drop that data, there is a small amount of internal overhead that remains. The one exception is that before 3.0, show dbs reported the admin database as empty in some cases, but there were no corresponding. WiredTiger does not report databases that do not have data, other storage engines may have different behavior here.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              kay.kim Kay Kim (Inactive)
              Participants:
              Last commenter:
              Kay Kim Kay Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Days since reply:
                3 years, 17 weeks, 6 days ago
                Date of 1st Reply: