I am working on a query that will filter documents with nodes, empty JSON arrays like this (Output property):
{
"Id": "0aec6b50-03ff-48c9-ac35-1b5e7640a892",
"Input": "00000000-0000-0000-0000-000000000000",
"Output": [
]
}
I am now using this query:
cts.orQuery([
cts.notQuery(cts.jsonPropertyValueQuery('Input','00000000-0000-0000-0000-000000000000')),
cts.jsonPropertyValueQuery('Output', '*', 'wildcarded')
])
It filters all documents with an empty (empty GUID) Inputand should (but not) filter documents with an empty (empty array) Output.
It works with a document:
{
"Id": "0aec6b50-03ff-48c9-ac35-1b5e7640a892",
"Input": "00000000-0000-0000-0000-000000000000",
"Output": ""
}
I assume this is because an empty array has a MarkLogic value. Has anyone had a similar problem? How to request an empty JSON array?
EDIT:
A non-empty message (which should be returned) is as follows:
{
"Id": "0aec6b50-03ff-48c9-ac35-1b5e7640a892",
"Input": "00000000-0000-0000-0000-000000000000",
"Output": [
"91ad81fe-9c82-4090-b6a9-a918f901de46"
]
}
source
share