Collections of elements should be stored and returned in the same order with MongoDB

Description

From the forum:

When I persist object with embedded collection that is defined like

1 2 3 4 5 6 7 8 9 10 ... private List<TimeInstant> values; @ElementCollection @Column(name = "values") public List<TimeInstant> getValues() { return values; } ....

this collection got persisted in random order.
I mean if my list is

1 {timeInstant1, timeInstant2, timeInstant3}

in database it may look like

1 2 3 "values" : [ { timeInstant2 }, { timeInstant1 }, { timeInstant3 } ]

List is initiated as an ArrayList.

Environment

None

Status

Assignee

Davide D'Alto

Reporter

Davide D'Alto

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major