Uploaded image for project: 'PHP ORMs'
  1. PHP ORMs
  2. PHPORM-209

Specify read preferences in query / aggregation builder

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • laravel-5.2.0
    • Affects Version/s: None
    • Component/s: Doctrine, Laravel
    • None
    • None
    • PHP Drivers
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?

      New method readPreference added to the query builder. It can be used on a DB query or a Model query.

      2. Would you like the user to see examples of the syntax and/or executable code and its output?

      DB::connection('mongodb')>table('books')>where('title', 'like', 'dragon')>readPreference('secondaryPreferred')>get()

      Books::where('title', 'like', 'dragon')>readPreference('secondaryPreferred')>get()

      3. Which versions of the driver/connector does this apply to?

      Laravel-MongoDB 5.2+

       

      Link to the driver documentation for more details: https://www.php.net/manual/en/mongodb-driver-readpreference.construct.php 

      Show
      1. What would you like to communicate to the user about this feature? New method readPreference added to the query builder. It can be used on a DB query or a Model query. 2. Would you like the user to see examples of the syntax and/or executable code and its output? DB::connection('mongodb') >table('books') >where('title', 'like', 'dragon') >readPreference('secondaryPreferred') >get() Books::where('title', 'like', 'dragon') >readPreference('secondaryPreferred') >get() 3. Which versions of the driver/connector does this apply to? Laravel-MongoDB 5.2+   Link to the driver documentation for more details: https://www.php.net/manual/en/mongodb-driver-readpreference.construct.php  
    • None
    • None
    • None
    • None
    • None
    • None

      There are scenarios where users want to perform operations from secondary.

      • Verify if read preferences can be set at operation level for Laravel and Symfony integrations.
      • Add this functionality if not present
      • Add related docs

            Assignee:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Reporter:
            rishabh.bisht@mongodb.com Rishabh Bisht
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None