How to exclude child elements when looping through categories? I've got a few categories set up with a few child categories for each. Each one has assets (PDFs) assigned to them, by going into the assets, double clicking, and setting the category field there. So for example:

Category 1
-- asset 1
- Sub Category 1
-- asset 2
-- asset 3

Category 2
-- asset 4
- Sub Category 1
-- asset 5
-- asset 6


But when I'm looping through the related assets, using:

 {% for category in craft.categories.group('categoryGroup').level(1) %}
    {% set resources = craft.assets.relatedTo(category).find() %}
      {% for resource in resources %}
        {{ resources.title }}
      {% endfor %}
 {% endfor %


I get: 

Category 1
- asset 1
- asset 2
- asset 3
- Sub Category 1
-- asset 1
-- asset 2
-- asset 3

Category 2
- asset 4
- asset 5
- asset 6
- Sub Category 1
-- asset 4
-- asset 5
-- asset 6


Which logically makes sense, that it's returning all assets related to the children categories, since those are also related to the parent. But how can I exclude them from the loop, so I only get back the assets that are directly related?
Rather than preparing multiple queries - you can execute the Query in your field value 

{% for category in craft.categories.group('categoryGroup').level(1).find() %}
    {% for resource in category.fieldHandle.find() %}
        {{ resources.title }}
    {% endfor %}
{% endfor %