How are references between components in different entities handled in ECSY?

Anything in ECSY, or recommended patterns, for handling references between components in different entities?

If I have one-to-many relationship between components (e.g. Foo and GroupOfFoos), what is the best way to implement that in ECSY? Should GroupOfFoos just contain a mutable property that is a Set of references to Foo objects? Or should Foo contain a reference to the GroupOfFoos to which it belongs. Or is there a cleverer more ECSey way to do it?

I don’t think ECSY has a built-in concept of relations. If you have many Foo entities that are in different groups, you could add a Group(groupName:string) component to them to identify which Group they belong to. Depending on what you do with these entities, you may want to have some kind of group caching to be able to query Foo’s by their Group instantly. (e.g. a System that updates lists of Foo’s by Group name when they are added/removed/their Group changes).

If Groups are predetermined and finite, you could make tag components for each group and have System queries work out of the box:

System.queries = {
  foosA: {components: [Foo, GroupA]},
  foosB: {components: [Foo, GroupB]}

Another way would be to have a single GroupOfFoos entity with a list of Foo’s as array property (if you don’t need each Foo to be a separate entity).

I might be missing something, I’m new to ECSY…