Filtering values from Twig for my custom field type
Would this help?

Filter Entries by Field Value

Than it would be something like this I suppose (never used it myself):

{% for item in entry.myCustomField.search('category':'main') %}
    {{ item.category }}
{% endfor %}