Skip to content

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

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

Open
zhangxueyii opened this issue Jul 18, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@zhangxueyii
Copy link

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
Copy link
Contributor

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

@tjlee tjlee assigned tjlee and unassigned kornilova203 Jul 26, 2024
@tjlee tjlee added the bug Something isn't working label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants