Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-814

/database in Connection String URI should be optional

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.0
    • Affects Version/s: 2.0.0
    • Component/s: Public API
    • Labels:
      None

      Documentation says that /database is optional (default is the 'admin' database) in the Connection String URI http://docs.mongodb.org/manual/reference/connection-string/

      For example:

          client = Mongo::Client.new("mongodb://localhost:27017")
      

      results in something like the following:

          /Users/gjm/10gen/mongo-ruby-driver/lib/mongo/database.rb:151:in `initialize': nil is an invalid database name. Please provide a string or symbol. (Mongo::Database::InvalidName)
                  from /Users/gjm/10gen/mongo-ruby-driver/lib/mongo/client.rb:226:in `new'
                  from /Users/gjm/10gen/mongo-ruby-driver/lib/mongo/client.rb:226:in `create_from_uri'
                  from /Users/gjm/10gen/mongo-ruby-driver/lib/mongo/client.rb:116:in `initialize'
                  from issues/uri_db.rb:22:in `new'
                  from issues/uri_db.rb:22:in `<main>'
      

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            gjmurakami Gary Murakami
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: