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

Invalid parameter for query: pipeline #5352

Closed
mtrezza opened this issue Feb 9, 2019 · 2 comments
Closed

Invalid parameter for query: pipeline #5352

mtrezza opened this issue Feb 9, 2019 · 2 comments

Comments

@mtrezza
Copy link
Member

mtrezza commented Feb 9, 2019

After upgrading from Parse Server 3.0.0 to a version >3.0.0 and <=3.1.3 (latest) the aggregate query in cloud code does not work anymore.

The query:

const query = new Parse.Query("MyClass");
const pipeline = {
    "sort":{"_created_at":-1}
};

const results = await query.aggregate(pipeline);

fails with error:

ParseError: 102 Invalid parameter for query: pipeline

I also tried the pipeline object as array which also fails:

const pipeline = [
    {"sort":{"_created_at":-1}}
];

Such an error can be thrown at:

Seems to be a bug because I did not find any breaking changes documented regarding aggregate.
Parse Server 3.1.0 made the jump from Parse JS SDK 2.0.2 to 2.1.0, so maybe it is a bug in the JS SDK.

Note: I am not using the Parse JS SDK as a client, it is only used through cloud code.

Any ideas?


I posted this on SO before, but it looks like a bug, so posting here.

@mtrezza
Copy link
Member Author

mtrezza commented Feb 10, 2019

To rule out possibly conflicting parse-server / parse JS SDK versions, I deleted parse dependency from parse-server-example and deployed on heroku with node_module_cache=false.

npm list shows parse@2.1.0 installed under parse-server@3.1.3.
Still getting the error.

It would be great if anyone could try to reproduce this with a simple aggregate query in cloud code.

@mtrezza
Copy link
Member Author

mtrezza commented Feb 11, 2019

So it's not a bug, it was a Parse Server vs. Parse JS SDJ mismatch.
I had two parse servers running on the same DB for testing during migration. Turns out that some URLs in the v3.x server still pointed to the other v2.8.4 server. After correcting the URLs all works fine.

Thanks @dplewis (on SO).

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