Closed lsb530 closed 2 years ago
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it. Right now, we struggle to understand what you want to achieve.
Yes, I think It is quite impossible because Aggregation called by API so it it runtime. But Java is compile language. Can it be added new field to Object in Runtime?
You can test yourself make Aggregation Implements Aggregation.addFields() ... mongoTemplate.aggregate ...
When i make specific DTO class, It worked to DTO class. I expect that Object.class be added new field but it doesn't work
I still struggle to understand what you want to achieve, 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.
Okay..! Since i am in company.. Approximately 1 hour half, i will make it at home. Thank you
Sorry for that. Configuration change something which i don't know. At home, I tested Aggregation with AggregationResults
Thanks for the feedback, glad it works for you now.
AddFieldsOperation addFields = addFields() .addField("type").withValue("test").build();
mongoTemplate.aggregate To Object.class..
But It didn't added fields dynamically.. I know java is compiled language, if you can update added field to Object.
It works differently Mongo Compass pipeline
Thank you