'client.use' doesn't change database

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 12_01_17
    • Affects Version/s: 2.0.2
    • Component/s: None
    • None
    • Environment:
      ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      client.use doesn't actually switch the database the client is operating on.

      [1] pry(main)> client = Mongo::Client.new([ '127.0.0.1:27017' ])
      => #<Mongo::Client:0x70164072306540 cluster=127.0.0.1:27017>
      [2] pry(main)> client.database
      => #<Mongo::Database:0x70164072301540 name=admin>
      [3] pry(main)> client.use('test')
      => #<Mongo::Client:0x70164072101580 cluster=127.0.0.1:27017>
      [4] pry(main)> client.database
      => #<Mongo::Database:0x70164072301540 name=admin>
      

            Assignee:
            Emily Stolfo (Inactive)
            Reporter:
            Justin Case
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: