Check if a database exists on MongoDB without using mongoClient.getDatabaseNames()

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Won't Fix
    • Priority: Blocker - P1
    • None
    • Affects Version/s: 2.11.1
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We configured our mongobd to forbid the "listdatabases" (i.e, mongClient.getDatabaseNames()) feature for privacy reasons

      I would like to check whether a database exists in MongoDB without using mongClient.getDatabaseNames().

      If I use, mongoClient.getDB("mydb"), mongodb creates a new db instance which can't help to check whether dbname exist.

      Can we have an api to check existance of database (like : mongoClient.isDBExists("db_name") )?

            Assignee:
            Ross Lawley
            Reporter:
            shiv
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: