cancel
Showing results for 
Search instead for 
Did you mean: 

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

promanov_
Star Contributor
Star Contributor

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.

1 ACCEPTED ANSWER

Florent_Guillau
World-Class Innovator
World-Class Innovator

This should work:

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

View answer in original post

4 REPLIES 4

Florent_Guillau
World-Class Innovator
World-Class Innovator

This should work:

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

Thanks! It works perfectly (run on Nuxeo 5.8).

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

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

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.