Open
Description
Vadzim Parafianiuk opened DATAMONGO-1965 and commented
If I use @Indexed
in one class, I want spring to create Index only in collection for this class, but it also creates index in another classes that use this @Indexed
class as embedded field. As a result, if I use "unique = true" it also affects embedded fields in another classes. See my question on stackoverflow with more rich description and example.
I've found a solution: I create ApplicationListener, and after context loading I use MongoTemplate to create indexes manually. But it is not convenient
Reference URL: https://stackoverflow.com/questions/49930576/spring-data-mongodb-indexedunique-true-in-inner-field