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

ReadPreference not working for aggregate query #6582

Closed
mtrezza opened this issue Apr 9, 2020 · 4 comments
Closed

ReadPreference not working for aggregate query #6582

mtrezza opened this issue Apr 9, 2020 · 4 comments

Comments

@mtrezza
Copy link
Member

mtrezza commented Apr 9, 2020

Issue Description

Setting the mongodb read preference is ignored for aggregate queries.

Steps to reproduce

const query = new Parse.Query("MyClass");
query.readPreference("SECONDARY");
const results = await query.aggregate([]); //Reads from primary

Expected Results

Should read from secondary.

Actual Outcome

Reads from primary.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 4.2.0
    • Operating System: [FILL THIS OUT]
    • Hardware: [FILL THIS OUT]
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): local
  • Database

    • MongoDB version: 4.2.5
    • Storage engine: [FILL THIS OUT]
    • Hardware: [FILL THIS OUT]
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): local

Logs/Trace

mongodb nodejs driver log:

"executing command [{"ns":"development.$cmd","cmd":{"aggregate":"MyClass","pipeline":[],"cursor":{}},"options":{}}] against mySecondary.locahost:27010"

@mtrezza
Copy link
Member Author

mtrezza commented Apr 9, 2020

The read pref is already missing in the request, I assume it's actually a JS SDK issue.

return this.handleFind(req);

@mtrezza
Copy link
Member Author

mtrezza commented Apr 9, 2020

Added failing test cases in PR #6585

@mtrezza
Copy link
Member Author

mtrezza commented Apr 9, 2020

Added JS SDK PR parse-community/Parse-SDK-JS#1143

@mtrezza
Copy link
Member Author

mtrezza commented Apr 14, 2020

Status:

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

No branches or pull requests

1 participant