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

Error when running aggregate query in version 2.7.1 #4479

Closed
xedixermawan opened this issue Jan 3, 2018 · 5 comments
Closed

Error when running aggregate query in version 2.7.1 #4479

xedixermawan opened this issue Jan 3, 2018 · 5 comments

Comments

@xedixermawan
Copy link

Hi,
I appreciate if someone can figuring out what is missing in my setup. thanks.

Issue Description

got an error when try to run aggregate request to a collection.
the collection is already filled with some data.

Steps to reproduce

  1. add some data to GameScore collection. just like the parse server example in readme
  2. run:
curl -X GET \
  -H "X-Parse-Application-Id: myAppId" \
  -H "X-Parse-Master-Key: myKey" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -G \
  --data-urlencode 'group:{objectId:'null',total:{$sum:'$score'}}' \
http://localhost:1337/parse/aggregate/GameScore
  1. error message :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /parse/aggregate/GameScore</pre>
</body>
</html>

Expected Results

the result of aggregate data.

Actual Outcome

error above

Environment Setup

  • Server

    • parse-server version : 2.7.1
    • Operating System: OSX
    • Hardware: Macbook Pro
    • Localhost or remote server? localhost
  • Database

    • MongoDB version: 3.4.10
    • Storage engine:
    • Hardware: local Macbook Pro
    • Localhost or remote server? localhost

Logs/Trace

Include all relevant logs. You can turn on additional logging by configuring VERBOSE=1 in your environment.

@bohemima
Copy link
Contributor

bohemima commented Jan 3, 2018

See #4466 (comment)

@xedixermawan
Copy link
Author

xedixermawan commented Jan 4, 2018

hi @bohemima , I saw your link before. I thought that error in the link was different and specific cloud code.
so, in version 2.7.1 , the aggregate feature don't work yet ?
anyway, I'll try the #4466 solution.

@xedixermawan
Copy link
Author

xedixermawan commented Jan 4, 2018

it works with latest version . i found curl example of aggregate queries is not correct in docs http://docs.parseplatform.org/rest/guide/#aggregate-queries . (missing string quote in json field, and ":" sign)
correct one :

  curl -X GET \
  -H "X-Parse-Application-Id: myappId" \
  -H "X-Parse-Master-Key: myappkey" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -G \
  --data-urlencode 'group={"objectId":null,"total":{"$sum":"$score"}}' \
  http://localhost:1337/parse/aggregate/GameScore

also for other example aggregate queries which make confusing for new user like me

@dplewis
Copy link
Member

dplewis commented Jan 4, 2018

@xedixermawan Please feel free to submit a PR https://github.com/parse-community/docs.

Please include any examples that will make it easier for new users to understand.

@dplewis dplewis closed this as completed Jan 5, 2018
@jadhavmanoj
Copy link

@xedixermawan what you did to fix your issue? I am on latest version of parse i.e. parse@1.11.0. still facing same issue. Parse server version is 2.7.1.

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

4 participants