Exclude entries by array of authors from ElementCriteriaModel I'm trying to get a list of entries of a certain section, however I'd like to exclude certain users that are defined within a field of the entry.

The users to exclude from the query are fetched like so:

{% set exclude_users = entry.winners_exclude %}


Now, what I'm trying to do is to exclude the users in theexclude_users-array from being returned with the query results, something like the following (which does obviously not work, but you might get the idea of what I'm trying:

{% for entry in craft.entries.section('bildupload').author(not in exclude_users).search('challengeId:' ~ch.id).order('likecounter desc').limit(3).with(['useruploads']) %}


Specifically I'm talking about the .author(not in exclude_users) part.

I didn't really find anything on the question if that is at all possible within the elementCriteriaModel query itself. It works with an additional if-condition within the for-loop, however since the elementCriteriaModel needs to be .limit(ed) to 3 but needs to exclude some users, excluding them within the loop after limiting the result to the first 3 results obviously results not in what I want, since it will just exclude the users from the first 3 results.
Iterating on Michael's answer: build an array of users to exclude, like this:

{% set excludeArray = null %}
{% for user in entry.winners_exclude %}
    {% if loop.first %}{% set excludeArray = ['and'] %}{% endif %} {# only set this array if exclude users exist #}
    {% set excludeArray = excludeArray |merge(['not ' ~ user.id]) %}
{% endfor %}

{# check if users should be excluded, I'm not sure what happens if you'd do .author(null) #}
{% if excludeUsers %}
    {% paginate craft.entries.section('bildupload').author(excludeUsers) %}
{% else %}
    {% paginate craft.entries.section('bildupload') %}
{% endif %}