Failing Many-to-One Relationship from Mongoose

Hi @David_Roegiers

Are you using flattenMode: 'none'?
Many to many relationships need to create a virtual collection from the array of foreign keys.

I’ll add a ticket on our side to improve the documentation.

Can you switch to the following configuration?

createMongooseDataSource(connection, {
  flattenMode: 'manual',
  flattenOptions: { offices: { asModels: ['lawyers'] } }
})

Edit:

Thanks! It was long overdue! :slight_smile:

3 Likes