How to count a type of nodes

@luke Here is how you can calculate number of nodes. For a schema say

type Person {
  	
    name
    age
    friend
    owns_pet
}

Then the query to get the number of Person Nodes with name would be.

{
      nodeCount(func: has(<name>)) {
        nodeCount: count(uid)
      }
}
1 Like