Closed myob-hankun closed 8 months ago
We have a hard time following what is happening here. Please provide a minimal reproducer or at least the MongoDB document as JSON so that we can understand the initial setup.
Thank you @myob-hankun for the json. However there are still some bits (like the ChartCollection or TableDTO) missing. If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.
Hi Team, I upgraded springboot to 3. spring-boot-starter-data-mongodb to 3.2.2. jdk to 21. And mongo is 5. So I think there is no problem with compatibility I have some errors.
And I have a java object
PublishedReportPackReport is
ChartCollection is a basic class. it has a child class
TopRevenueContributingItemDTO is
ChartDTO is
LineChartDTO is
Currently, when I use findAllById(), it has an error.
org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.math.BigDecimal] for value [Food]
The
Food
is the name field of the LineChartDTO class. TopRevenueContributingItemDTO also has this error.I think it should be of string type directly, but Mongo wants to map Food to BigDecimal, and the name field is defined as String instead of BigDecimal. Why does this happen?