I am looking to how to implement the collections-not for Marklogic TDE.
The equivalent one for the CTS query is
cts:not-query(cts:collection-query("archived"))
According to TDE documentation, it only supports AND, OR collections. I am looking for NOT collections with TDE schema.
EDIT: I changed the sample from: '.. = "include"..' to '... != "exclude"...' They both work. However, for the context of the question, not-equal makes more sense in an example.
As odd as it seems, the feature that you are asking for is not available. However, there is a way to make use of the context that can help you. First of all, it is still good to set a collection or collection scope so that we minimize the sample set to analyze the context path.
The approach is to use xPath and xQuery on the context as a filter.
Below is a working sample for Query Console. Please not the ';' in the code as it is a multi-statement sample.
The result shows that both documents were considered, but only the one with the collection "include" is parsed.