How to query all nodes/edges/types in a database


#1

Is there a way to query all nodes/edges in the database? Also, is there a way to query a list of types the database has in it?


(Michel Conrado) #2

If you query for schema {} you gonna have a list of all predicates and also all types in the "types" key.

You can use “has func” with all know predicates. But keep in mind that this query will be very expensive. Also you can use the Debug Tool and it will log all data that exists in the posting list folder.


#3

There really needs to be a better way to do a query to get the whole graph. I know it’s expensive, but it’s sorely needed. I’m trying to show the whole graph and need a way to do it. I don’t expect my graphs to be that large in most cases, but I need a way to query everything.

Is there a way I can use types instead of predicates?


(Michel Conrado) #4

Yes https://docs.dgraph.io/query-language/#using-types-during-queries