Hi, anyone able to help with a relationship thing?
I have several schemas set up, like, Country, County, and Business, each country has counties (county) each county has businesses, so, each business belongs to one county and I want to be able to GROQ all businesses in a county.
I have made a query for all counties in a country where I add a county to a country then I can get the county names from the country *`*[_type == "country"]{...,county[]->}`* but I don't want the user to have to add the business to a county as logically when you're entering the address details for a business in the CMS you'd do it all in on data entry form, I guess... If it's not all in one place then the user will probably forget to add the business to the county then there'll be no record of it when searching for businesses by county.
What I trying to articulate (badly) is that I want to do the reverse for relationships so I can get all businesses in a county by adding the county to the business rather than the business to the county
Dec 28, 2020, 8:11 PM