Select Field from Component

System Information
  • Strapi Version: 3.5.4
  • Operating System: Alpine
  • Database: Postgres
  • Node Version: 12.20.1
  • NPM Version: 6.14.10
  • Yarn Version: 1.22.5

I have a collection Locations and and a component Address of type Information. I’m running a custom query on the collection in order to run some geospatial queries on some information that’s stored in the component. If I perform a fetchAll, I believe Strapi is doing some work behind the scenes to grab all related collections and returns my component, but I’m trying to do a select query on a field that is stored in that component collection. When I try to run this query I get an error that the selected field doesn’t exist. I have pasted a sample of my code below. My component field is GeoJSON.

const result = await strapi.query('location').model
    .fetchAll({
        debug: true,
        columns: ['Name', 'GeoJSON']
    })

return result;
1 Like