We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Dmitry Bekrenev opened DATAMONGO-2611 and commented
An example we have next data:
{ "_id" : ObjectId("5f3a61e5145c553d7d463fb9"), "location" : [ 1, 2 ], "userId" : 1 } { "_id" : ObjectId("5f3a61eb145c553d7d463fba"), "location" : [ 3, 4 ], "userId" : 5 } { "_id" : ObjectId("5f3a61f2145c553d7d463fbb"), "location" : [ 6, 7 ], "userId" : 8 }
and next query:
{$group: {_id: {userId: "$userId", lat: {$arrayElemAt: ["$location", 1]}, lng: {$arrayElemAt: ["$location", 0]}}}}
Problem: Looks like no way to implement the query by the Aggregation framework.
Expected behavior: I expect that is will be possible to implement by next code:
val groupByUserIdAndLocation = Aggregation.group("userId") .and( ArrayOperators.arrayOf("location") .elementAt(0) ).as("lng") .and(ArrayOperators.arrayOf("location") .elementAt(1)).as("lat")
Affects: 3.0.3 (Neumann SR3)
The text was updated successfully, but these errors were encountered:
christophstrobl
No branches or pull requests
Dmitry Bekrenev opened DATAMONGO-2611 and commented
An example we have next data:
and next query:
Problem:
Looks like no way to implement the query by the Aggregation framework.
Expected behavior:
I expect that is will be possible to implement by next code:
Affects: 3.0.3 (Neumann SR3)
The text was updated successfully, but these errors were encountered: