Vivat
(Vitaliy Vostrikov)
1
How can I get count of all entities founded by name when I do need only a part of it?
I needed something like that:
all as var(func: regexp(entityName, /some name/)){}
entities(func: uid(all), first: 5,offset:10) {
uid
entityName
...
}
counters(){
total: count(all)
}
Dgraph: 1.0.4
pawan
(Pawan Rawal)
2
Did you try something like the below?
all as counters(func: regexp(entityName, /some name/)){
total: count(uid)
}
entities(func: uid(all), first: 5,offset:10) {
uid
entityName
...
}
1 Like
Vivat
(Vitaliy Vostrikov)
3
Ye, I get something like that: {“counters”:[{“total”:5}],}. That’s what I need, Thx. But why “total” must be in array?
pawan
(Pawan Rawal)
4
We return an array irrespective of the number of objects (1 or more), so that clients can expect a standard interface while parsing the response.
1 Like
system
(system)
Closed
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.