Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Mongo ReadPref on Individual Method Calls #1301

Open
fitzagard opened this issue Aug 15, 2016 · 0 comments
Open

Allow Mongo ReadPref on Individual Method Calls #1301

fitzagard opened this issue Aug 15, 2016 · 0 comments

Comments

@fitzagard
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants