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

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      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!

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

              Created:
              Updated:
              Resolved: