How to create a live query to filter pages without specific tags?

In my case, I have some pages and some of them have tags, I want to build a welcome page and list them in some block like:

  • TOC
    … all my pages
  • Worklogs
    … pages which tags contains #work

I tired to use (and namespace xxx) with (not(or tag1 tag2)) but it not working :frowning_face: . And I noticed that the “not” operator can’t work well with “or”, becuase once I deleted “or” and “tag2” from live query, it successfully filter pages I want but with pages contain tag2.

It’s because you want both tags not to be in the query results. It’s not or, but and.
Though it’s not and at the same time only.
(Ok that sounds confusing sorry!)

As an example:
{{query (and [[test]] (not [[date/1990]]) (not [[example]]))}}

For my test graph this gives me:

And without the not conditions you’ll see extra results: