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

Would like to know if a collection already exists without automatically creating one

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.0
    • None
    • None
    • None

    Description

      I have a use case in which I would like to check for the existence of a collection without creating a new one automatically if it already exists.

      I am new to MongoDB, but I'm proposing a change to DB.java to add this functionality.

      I've updated to include:
      public boolean collectionExists(String collectionName)

      and the test for it in DBTest.java.

      The attached patch includes the changes (created from my github fork of the driver project).

      Please consider it for inclusion.

      Thanks!

      Attachments

        Activity

          People

            eliot Eliot Horowitz (Inactive)
            djktno Daniel Kunnath
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: