Contentful logo

Contentful Community

Entries and references

Hi,
I have an issue with Content Delivery API retrieving entries and references.

I have a simple structure like this:

  • Products
    –Models
    Some PRODUCTS that have some other MODELS as reference.
    In my web page I only have the product id and I want to get all the models referenced to the products. I achieve that by using getEntry() filtered by id, then I find out my models. But what I need is get all models of a specific product instead of getting the product and then find my models. This because I need a pagination and I think it would be a more correct way to get my entries.

Is there a way to use getEntries() to retrieve all models of a particular product id?

Regards,
Gianluca

Hi @gianluca,

You can try the Links to Entry in our CDA:

This should help you with the problem.

Thanks @Alma. But that’s not what I need.
With links_to_entry I retrieve all entries that have my selected entry as reference. I need the opposite query, get all my entries referenced to an entry.
Example:
My entry Parent has a field Children that is a reference to many entries.
I have Parent entry id and I have to get all my children with a query.

Thanks