Show only top level categories assigned to an entry Having a bit of a brainfart here...
If hotspotCategory is my entry's categoryfield and that category group has nested categories, how do I return only the top level categories?

{% set entryCats = entry.hotspotCategory %}
{% if entryCats | length %}
    &lt;span class="filter_cat"&gt;
       {% for cat in entryCats %}
          {{ cat.title }} {% if not loop.last %}, {% endif %}
       {% endfor %}
     &lt;/span&gt;
 {% endif %} 


this works but if I do something like

{% set entryCats = entry.hotspotCategory.level(1).all() %}


I get an

Impossible to invoke a method ("level") on an array.


error.

What am I missing here?

To clarify: my entry has the following categories attached (slow &amp; fast food are subcategories):

- food &amp; dining
--- slow food
--- fast food


Now, on the entry page I only want to display the top level category, not the subcategories.
You might want the siblings of the selected Category via siblingOf - I think you'll need to do this with two steps.