How can I count all nodes and edges

I want to make sure that whether I had import all data into dgraph, but I can not find corresponding API in document, am I missing something?

Dgraph is designed to be a distributed system, and counting the number of nodes and edges isn’t scalable. We can provide some rough estimations, but it won’t be accurate.

@yupengfei, I’m just learning to use Dgraph’s GraphQL, but if you wanted to count the number of edges with a given predicate and value (in my case, predicate VertexType, literal value “Class”), I think you can run this…

{
	classes (func: eq(VertexType, "Class")) {
		count()
	}
}

Result:

{
    "classes": [
        {
            "count": 7
        }
    ]
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.