Rename Connection::getMongoDB and getMongoClient to getDatabase and getClient

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Trivial - P5
    • laravel-5.2.0
    • Affects Version/s: None
    • Component/s: Laravel
    • None
    • PHP Drivers
    • Needed
    • Hide

      Replace any call to Connection::getMongoDB with getDatabase

      and Connection::getMongoClient with getClient

      Show
      Replace any call to Connection::getMongoDB with getDatabase and Connection::getMongoClient with getClient
    • None
    • None
    • None
    • None
    • None
    • None

      https://github.com/mongodb/laravel-mongodb/pull/3205#discussion_r1859818502

      Noted that the Connection class has getMongoDB() and getMongoClient() methods that return a MongoDB\Database and MongoDB\Client, respectively. Not a fan of those names, as they smell like the legacy extension API.

      I'm not sure why they couldn't just be getDatabase() and getClient(). That seems beyond the scope of this PR, though.

      In 5.x:

      • add Connection::getDatabase and getClient,
      • deprecate Connection::getMongoDB and getMongoClient

      In 6.x:

      • remove Connection::getMongoDB and getMongoClient

            Assignee:
            Jérôme Tamarelle
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: