-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Parse-server V6.3.1 query.distinct("score") throw ParseError: Invalid aggregate stage 'hint' #8804
Comments
Thanks for opening this issue!
|
I am having the same problem |
I'm updating an older Parse 5.2.x server running against MongoDB 4.4. I noticed this deprecation warning in my logs:
Could your error be related to this? If you are running MongoDB 5 or higher maybe they no longer support distinct queries without the leading '$'. I came here to validate that a new parse server implemented this change. BTW, your description says you are running Parse Server 6.3.1 but the extra details say Parse Server 5.6.1. Can you verify that? Are you in a position to test this against MongoDB 4.4 and/or against the latest Parse Server? |
Following up on my comment above, I can verify that these issues are related. I updated my Parse Server 5.2.x server all the way to MongoDB 7.x and still received the DeprecationWarning. Everything worked though. Next, I upgraded to the latest 5.6.x Parse Server and everything was working. Finally, I upgraded to latest Parse Server 6.4.x and now I get the same error as described in the initial bug report. I rolled back to 6.0.x and confirmed the bug was introduced between 5.6 -> 6.0. I am using a distinct query on an object pointer in Cloud Code if that helps narrow it down. I'll keep digging as well. |
Update
My pseudocode:
|
@chadpav Would you want to open a PR with a failing test, and do you have a suggestion for a bug fix? Once we have a failing test we can also put a bounty to expedite the fixing. |
I have a work around and I did try to dig into the server code but it's a little beyond my skillset to do so. Hopefully I've narrowed down the reproduction steps for you guys. |
It happens because Original code:
A fix:
A test:
|
@Chilldev would you want to submit a PR with a failing test? |
@mtrezza Sure. Let me check the contribution guide. |
The issue occures when directAccess is set to true and the distinct query is wrapped within an eachBatch. I wrote the test but for it to work I have to comment this line:
The error occures because this is what naturally happens when parse server started with
|
🎉 This change has been released in version 7.4.0-alpha.4 |
New Issue Checklist
Issue Description
const distinctResult = await query.distinct("score");
parse-server v6.3.1 This code will give you an error.
ParseError: Invalid aggregate stage 'hint'.
Steps to reproduce
Actual Outcome
ParseError: Invalid aggregate stage 'hint'.
Expected Outcome
no error message
Environment
Server
V6.3.1
win11
local
Database
MongoDB
5.0
Local
Just use the third release tool to request it directly
Logs
Some Detail
The text was updated successfully, but these errors were encountered: