1

User model have collection of host and collection of accounts.

Host model have collection of accounts and collection of users.

Account have collection of hosts and collection of users.

How I can found all User hosts, with accounts?

  {
  id: 1,
  name: 'User',
  hosts: [{
    id: 1,
    accounts: [
    {
      id:1
    },
    {
      id:2
    }]
  },
  {
    id: 2
    accounts: [
    {
      id:13
    },
    {
      id:4
    }]
  }
  ]
}
Dilan Mckey
  • 157
  • 10

1 Answers1

0

I have the same problem as you, and found that waterline can't populate models more than one level down. But you can write some hack like this: the same problem question. Don't sure, that it is perfect solution, but may be it helps.

Community
  • 1
  • 1
Ivan Kalita
  • 2,197
  • 1
  • 18
  • 31