Skip to content

Duplicate index creation on embedded documents [DATAMONGO-1025] #1949

@spring-projects-issues

Description

@spring-projects-issues

marius popa opened DATAMONGO-1025 and commented

Having the documents:

@CompoundIndexes({ @CompoundIndex(collection="timeRead", name = "eventIdAndChip", def = "{eventId : 1, chip : 1}"), @CompoundIndex(collection="timeRead", name = "eventIdAndPublish", def = "{ eventId : 1, publish : 1}"), @CompoundIndex(collection="timeRead", name = "chipAndTimeReadTickIndex", def = "{'chip' : -1, 'timeReadTick' : 1}") }) @Document public class TimeRead { }

and

@Document public class TimeReadChip { private Map<String, TimeRead> timeReads; private Map<String, TimeRead> pointNameToTimeRead; }

The Mongo driver tries to create the same indexes twice: once because they are defined as compound on TimeRead (which is correct), and a second time when parsing the TimeReadChip document (incorrect). I'm assuming it sees the Map<String, TimeRead> and tries to create indexes on timeRead collection (again). This bug was introduced after 1.3.5.RELEASE


Affects: 1.5.2 (Dijkstra SR2)

Issue Links:

  • DATAMONGO-1027 Collection inherits complex index from embedded class/object
    ("is duplicated by")

Referenced from: pull request #219

Backported to: 1.5.4 (Dijkstra SR4)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions