Skip to content

Invalid parameter for query: pipeline #5352

Closed
@mtrezza

Description

@mtrezza

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions