Question about "Drop All"

I don’t understand how this command work.
After executed below command, I insert same schema and a new node with same properties as before.

To drop all data and schema:
curl -X POST localhost:8080/alter -d '{"drop_all": true}'

This won’t reset uid to 0x0, right?
If I use func: eq , it only get the new node.
But If I use uid with old node uid. I can also get old data. So, the data drop strategy here is not really drop for efficiency? Will it do really drop automatically in future if storage free space is not enough? Or should I have to stop dgraph and delete p&w directory manually?

Yeah, this doesn’t reset the uid, the uid would continue from the last allocated uid. Though drop all should drop all the data.

Can you give an example? I suppose you are just trying to query using the uid, something like

{
  me(func: uid(0x01)) {
    uid
  }
}

In this case, Dgraph would always return the uid back irrespective of its value and this is not a good way to check if the node exists. See func: uid() always returns data, even if node does not exist · Issue #2086 · dgraph-io/dgraph · GitHub. You should not get back any other predicate after doing a drop all though.

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