Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-196

Existence of namespace in mongodb

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 0.90.0
    • 0.7
    • None
    • None
    • Centos/ 6.3

    Description

      I attempted to use mongo_validate_ns() to determine if e.g. mydb.frog already existed, but apparently the routine only validates whether or not the ns string is well formed, not whether or not the db/collection combo already exist under the mongo server.

      I looked through the source and (still pretty sketchy) documentation and couldn't find anything that either did the equivalent of "show dbs" or "show collections" or (more reasonably) mongo_exists_ns() – a routine that returns a list of the existing mongodb dbs and their collections or a routine that takes a well-formed ns and tells you if THAT collection exists already.

      Possibly for the future?

      rgb

      Attachments

        Activity

          People

            christian.hergert@10gen.com Christian Hergert
            rgb Robert G. Brown
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: