Hi,
I’m having trouble querying for data where a predicate is an empty string.
The scenario here is that I have some data where the value is an empty string and I need to find that data. For example:
{
"data": {
"rooms": [
{
"name": "room 1"
},
{
"name": "room 2"
},
{
"name": ""
}
]
}
}
and I want to get a count of rooms which do not have a name.
{
rooms(func: has(room)) {
count(room @filter(eq(room, "")))
}
}
But that returns Empty argument received
. I tried replacing the string with "_nil_"
(read that somewhere), but although it doesn’t error it doesn’t return a count of rooms without a name either.
Is there a way to search for empty strings?
Thanks!