Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1515

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

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Blocker - P1 Blocker - P1
    • None
    • 2.11.1
    • API
    • None

    Description

      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") )?

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            shivb shiv
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: