Skip to content

ParseQuery.order is missing in beforeFind hook #6164

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

Closed
virtualtoy opened this issue Oct 28, 2019 · 3 comments · Fixed by #6237
Closed

ParseQuery.order is missing in beforeFind hook #6164

virtualtoy opened this issue Oct 28, 2019 · 3 comments · Fixed by #6237
Labels
type:feature New feature or improvement of existing feature

Comments

@virtualtoy
Copy link

Is your feature request related to a problem? Please describe.
When I access query in beforeFind hook I cannot access order information.

Describe the solution you'd like
I would like to be able to retrieve order information.

Describe alternatives you've considered
So far I see no alternatives to this problem for now.

Additional context
Possible solution is to add order information data in file src/triggers.js (not sure about implications, seems pretty straightforward):

@@ -460,6 +460,9 @@ export function maybeRunQueryTrigger(
     if (restOptions.limit) {
       parseQuery._limit = restOptions.limit;
     }
+    if (restOptions.order) {
+      parseQuery._order = restOptions.order.split(',');
+    }
     count = !!restOptions.count;
   }
   const requestObject = getRequestQueryObject(
@dplewis
Copy link
Member

dplewis commented Oct 28, 2019

Sounds like a good idea. Would you like to open a PR for this?

@dplewis
Copy link
Member

dplewis commented Oct 29, 2019

@virtualtoy There are a few query fields missing. If you want to get started, add your test cases here and read the Contributor's Guide to run your tests

@virtualtoy
Copy link
Author

@dplewis I'd like to but looks like I cannot run tests on windows. Let me resolve issue with tests first

dplewis added a commit that referenced this issue Nov 23, 2019
dplewis added a commit that referenced this issue Nov 23, 2019
* beforeFind: Improve request.query object

Closes: #6164

* can modify exclude query
UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this issue Mar 21, 2020
* beforeFind: Improve request.query object

Closes: parse-community#6164

* can modify exclude query
@mtrezza mtrezza added type:feature New feature or improvement of existing feature and removed type:improvement labels Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants