Get entries NOT related to categories is it possible to grab all the entries in a section that arent related to a category?

So something like

craft.entries.section('news').relatedTo('not',category)


Doesnt seem to work but is there some other syntax?
If you want to do it in a single query, Marion's answer is probably the best.

Otherwise, you could do something like this:

{% set idsHavingCategory = craft.entries.section('news').relatedTo(category).limit(null).ids() %}

{% set omitIds = 'and, not ' ~ idsHavingCategory|join(', not ') %}

{% set entries = craft.entries.section('news').id(omitIds) %}


Inspired by this article, which shows how to (1) grab ids, and (2) query against them:


  http://webstoemp.com/blog/manipulating-craft-elementcriteriamodel-with-twig/


Also references related solutions found in these answers:


https://craftcms.stackexchange.com/a/4930/45
https://craftcms.stackexchange.com/a/4573/45