Drop Data
We’re overhauling Dgraph’s docs to make them clearer and more approachable. If you notice any issues during this transition or have suggestions, please let us know.
It is possible to drop all data from your Dgraph backend, and start fresh while retaining the same endpoint.
Be careful, as this operation isn’t reversible, and all data is lost. It is highly recommended that you export your data before you drop your data.
Dropping data programmatically
You can drop data by invoking the dropData
mutation on /admin/slash
endpoint.
As an example, if your GraphQL endpoint is https://<your-backend>/graphql
,
then the admin endpoint for schema is at https://<your-backend>/admin/slash
.
This endpoint requires authentication.
Here is curl example.
If you would like to drop the schema along with the data, then you can set the
allDataAndSchema
flag.
Self-managed
Drop data and schema
The /alter
endpoint is used to drop data.
To drop all data and schema:
To drop all data only (keep schema):
The /alter
endpoint can also be used to drop a specific property or all nodes
of a specific type.
To drop property name
:
To drop the type Film
:
Was this page helpful?