NXQL: how to query docs with a list property attribute equal to null / empty / unvaluated?

I have a custom doc model with a list attribute containing IDs to other objects, thus representing a list of links.

I'd like to query objects that have no values on this attribute, something like:

SELECT * FROM Document WHERE dc:subjects = NULL

Is it possible? I've not found anything like this in the official NXQL doc.

Thanks.

0 votes

1 answers

1915 views

ANSWER



This should work:

SELECT * FROM Document WHERE dc:subjects/0 IS NULL
0 votes



Thanks! It works perfectly (run on Nuxeo 5.8).
04/14/2014

As you can see the semantics are slightly different from what you're asking, but I think this is the best we can do. Also dc:subjects/* IS NULL may be actually very slightly more efficient.
04/14/2014

Indeed.. not obvious to figure it out by yourself. Still, as long as it does the job it's just as good. Thanks again.
04/14/2014