After upgrading from Parse Server 2.8.4 to 3.1.3 an 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}}
];
It seems to fail in ClassesRouter.js which does not recognize the pipeline
key.
Why is that?
Update: Opened an issue on GitHub because it looks like a bug.
Try updating both Server and SDK to latest versions.
This issue may have happened because you used a newer SDK on an older version of parse or vice verse