Mutual connections in Strapi

24 Views Asked by At

Here's something I cannot understand about kind of mutual connections and how to realize it the best way. Let's imagine Tinder. There's an object Human with some properties (gender, age, name etc) He likes some other Humans , other Humans likes him, that is ok, no problems. The problem starts when I try to make the mutual connections.

What I want to get: Object Human has a parameter that links to an object Match, that has 2 links: human1 and human2

But it doesnt works. Only second human has a correct link.

PLEASE could you share your vision of the best way how to architect this need the best way, that both of humans has a correct link to Matches at the same parameter?

Example: Humans:

[{
id: 1,
matches: [1]},
{
id: 2
matches: [1]
}]

Matches:

[
  { id: 1
    human1: 1,
    human2: 2
  }
]
0

There are 0 best solutions below