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

Existence of namespace in mongodb

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 0.90.0
    • Affects Version/s: 0.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Centos/ 6.3

      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

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

              Created:
              Updated:
              Resolved: