I noticed a new bug with the MongoDB Community Server 7.0.6 release (Ubuntu Linux), using $sort in an aggregation. I did not experience this bug with 7.0.5.
This is causing a major issue for us right now in production. We are using mongo atlas, and our version was updated to 7.0.6, which it seems, introduced the error.
This is affecting us as atlas customer as well. Cluster automatically upgraded to 7.0.6, no way back.
Thanks for creating an issue @Andras_Belicza. Hope this gets resolved and pushed to all atlas clusters asap as I currently am unable to create a workaround.
@Andras_Belicza one way we can still use the pipeline with above stage is when we introduce addFields between limit and lookup stages.
Its a temporary way untill we get a fix from mongodb side
I encountered the same issue, but after indexing the field used for sorting in the desired order, my problem was resolved. earlier I got this error:
“PlanExecutor error during aggregation :: caused by :: Limit code returned unexpected value”