lithium icon indicating copy to clipboard operation
lithium copied to clipboard

Allow Mongo ReadPref on Individual Method Calls

Open fitzagard opened this issue 9 years ago • 0 comments

It would be useful to allow the setting of Mongo readPreferences on individual method calls. Currently, we can only override the readPreference on the connection which limits flexibility. The proposal is to allow something like:

$conditions = ['old' => true]; $readPref = ['secondary', [['dc' => 'north']]]; $oldBooks = Books::all(compact('conditions', 'readPref'));

The ultimate solution will be to allow readPreferences to be set on connection, database, collection and method call.

fitzagard avatar Aug 15 '16 04:08 fitzagard