Skip to content

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

Open
@iDommel

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.

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