Does ObjectBox guarantee the order of an items in a ToMany collection?

40 views Asked by At

The main question is: to create some explicit property in the Bar class like "externalOrder" or not.

I have some external data that must be imported into my test project. Does ObjectBox guarantee the order of an items in a ToMany<> collection after adding them to Box storage and requesting back in any moment of time in code?

class Foo {
  ToMany<Bar> relatedItems;
}

class Bar { ... }
1

There are 1 answers

0
Uwe - ObjectBox On BEST ANSWER

ObjectBox does not guarantee the order of items in a relation. They should currently be returned ordered by ID, but there is no guarantee this won't change.