Skip to content

Aggregation -> projected fields are not returned in specified order in DataGrip #21

@zhangxueyii

Description

@zhangxueyii

It's an issue in DataGrip, the query works well in mongosh 1.5.0.

Test Data:

Suppose I a collection for test like this, in which the fields are _id, address, id:
image

Note field address goes before field id.

Query:

db.testaa.aggregate([
{
    $project: {
        _id: "$_id",
        id: "$id",
        address: "$address",
}
}]);

The Problem:

The query is to project fields and expect the field id goes before field address. it works well in Mongosh 1.5.0 but not work in DataGrip (2021.3.1, with driver ver. 1.15, JDBC4.2). In DataGrip, it returns the correct fields values but in default order, instead of the specified order in project expression.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions