Skip to content

Document the usage of populate in the case of multiple nested fields to populate #145

Description

@iDommel

It would be nice to have a few lines of documentation showing that you should use spaces when you want to populate multiple nested fields.

When you have a request that looks like:
/orders/${id}?populate=quotation.customer,quotation.quotlines,movements

you end up with a populate object that looks like:
population [ { path: 'quotation', populate: { path: 'quotlines' } }, { path: 'movements' } ]
Instead of :
population [ { path: 'quotation', populate: [{ path: 'quotlines' }, { path: 'customer' }] }, { path: 'movements' } ]

The solution to that is that your request should be made using spaces for consecutive fields from the same key, like so:
/orders/${id}?populate=quotation.customer quotlines,movements

That solution was provided by a veteran user from my team, but it would be nice for it to be documented in the readMe in the populate section.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions