How can I select all data from dgraph ?

when i use dgraph query ,

i want to view all data in dgraph,

how can i write the query ???

thanks ! ! !

1 Like

I don’t think you can do that with one query, so I’d first query for predicate names using

schema {}

and then for each predicate I’d fetch something like

{
  foo(func:has(PREDICATE_NAME_HERE)) {
    uid,
    expand(_all_) { 
      expand(_all_)
    } 
  }
}

don’t try that for large databases without pagination :grinning:

1 Like

thanks, i will try that…

Found an answer by @chengxuncc in this other thread:

{
  showallnodes(func: has(dgraph.type)){
    dgraph.type
    expand(_all_)
  }
}