I've defined a path range index for a field and it might happen that the field value is null. The object stored in Marklogic is like:
{"the": {"path": {"to": {"field": null} } } }
I've tried the query
cts:path-range-query("/the/path/to/field", "=", json:null())
and it doesn't return any result. If, instead I define a new value for when the field is null and create an index just for this case, the search return results.
New document:
{"the": {"path": {"to": {"field": null, "fieldIsNull": true} } } }
New query:
cts:path-range-query("/the/path/to/fieldIsNull", "=", "true")
how can I search for null values using a path range index without resorting to a new index?
I'm using Marklogic 9.0-4.