You could use upsert to do this. https://docs.dgraph.io/master/mutations/#upsert-block. If you have trouble writing a query, happy to help. You query in upsert would query everything that you want to delete and the mutation would delete all the data that you want to delete.