-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Custom converter not used in aggregation pipeline after $replaceRoot stage #4285
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
Comments
Would you happen to have an example handy that reproduces your use case? |
My domain class looks like
And the failing aggregation is
And my custom convertor is
The custom convertor is registered like
|
We had to downgrade to version 4.0.0 because of this bug. Is there any estimate of when this will be fixed? |
Are there any updates regarding this issue ? |
I've also come across this issue in as a breaking change in 3.4.7, which is the same change that causes this: #4240. The first issue I had was because the mapping hasn't happened when this check occurs to see if the last pipeline stage is
I then tried ensuring this stage wasn't last in the pipeline. I then ran into the issue noted here as the previous stage was |
This problem is stopping us from upgrading to latest version. @mp911de is there any plan to fix this? Or we'll have to adapt to this limitation? |
This issue seems to be solved on 4.2.1 version. Just checked it today. |
Hi,
We observed this issue after migrating from 3.4.2 to 4.0.1
We are using a custom converter for mapping ZonedDateTime to Date and vice versa. With the old version our aggregation worked fine, after upgrading we received the following exception:
Our aggregation is using a $match stage in the pipeline right after $replaceRoot; in this $match, we compare to a ZonedDateTime vale. This should work properly, as we registered a custom converter for this type.
After some debug, we think that this was introduced by Avoid multiple mapping iterations.
Second mapping iteration is needed, because Aggregation#toPipeline method internally looses the initial RelaxedTypeBasedAggregationOperationContext after Aggregation#replaceRoot (after this stage the NoOpAggregationOperationContext is used, which doesn't seem to pick up the custom converters).
The text was updated successfully, but these errors were encountered: