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

Client#use API documentation does not match behavior

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.7.0.rc0
    • Affects Version/s: 2.5.3
    • Component/s: Docs
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The documentation provides incorrect incorrect information on Mongo::Client#use.  

       

      #use(name) ⇒ Mongo::Client
      Use the database with the provided name. This will switch the current database the client is operating on.
      

      This is incorrect.  The #use method does not switch the current database the client is operating on.  Instead, it creates a new client that does use the new database and returns it.  

      There appears to be no way to actually switch a client to a new database once created.  

      I also suggest reconsidering the method name since the name itself is misleading in this regard, even if the documentation itself is fixed to reflect what the driver actually does.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            uidzip Tom Lahti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: