DataGrip / mongo-jdbc-driver

This driver is embedded to DataGrip
Apache License 2.0
52 stars 11 forks source link

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

Open zhangxueyii opened 2 years ago

zhangxueyii commented 2 years ago

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.

kornilova203 commented 2 years ago

Probably driver returns fields in correct order. The problem is that DataGrip shows them in alphabetic order I created an issue in DataGrip project: https://youtrack.jetbrains.com/issue/DBE-15972