How do I limit entries retrieved except those with a sticky lightswitch on the entry? I have a list of "meetings" as entries and I want to show only the last two ordered by meetingDate, and show any other meetings marked as sticky, without doubling up.

What I have so far is:

{% set stuck = craft.entries.section('meetings').relatedTo(subcategory).sticky('1').order('meetingDate desc').find() %}
{% set entries = craft.entries.section('meetings').relatedTo(subcategory).order('meetingDate desc').limit(2).find() %}
{% set entries = entries|merge(stuck) %}


Now this works except that if an entry marked as Sticky is one of the first two, then it shows twice. I understand it is bad practice to try and manipulate data using Twig, and that rather I should aim on getting the right data out of the entries first up.
One method is to check to see if item is not in array before merging. The downside is that the entries will just be appended vs sorted by meetingDate.

{% set stuck = craft.entries.section('meetings').relatedTo(subcategory).sticky('1').order('meetingDate desc').find() %}
{% set entries = craft.entries.section('meetings').relatedTo(subcategory).order('meetingDate desc').limit(2).find() %}

{% for stuckEntry in stuck %}
    {% if stuckEntry not in entries %}
        {% set entries = entries|merge([stuckEntry]) %}
    {% endif %}
{% endfor %}


The other method is to grab the ids from the 2 queries and then merge them together, and perform a new query which can be sorted.

{% set stuckIds = craft.entries.section('meetings').relatedTo(subcategory).sticky('1').ids() %}
{% set entryIds = craft.entries.section('meetings').relatedTo(subcategory).limit(2).ids() %}

{% for id in stuckIds %}
    {% if id not in entryIds %}
        {% set entryIds = entryIds|merge([id]) %}
    {% endif %}
{% endfor %}

{% set entries = craft.entries.id(entryIds).order('meetingDate desc') %}