Hi,
We are testing DGraph as new technology to store & explore our business data.
We are stuck because we can’t delete nodes literal values.
Here are the step to reproduce the issue :
We use Kubernetes (through microk8s) and install DGraph as following :
kubectl create -f https://raw.githubusercontent.com/dgraph-io/dgraph/master/contrib/config/kubernetes/dgraph-single.yaml
The version of Ratel is :
Built at 2019-04-01T20:12:42.329Z
Commit: c30e6f0
Commit Info: c30e6f0 Fri Mar 22 18:44:20 2019 +0200 (HEAD -> master)
We use following schema :
<xid>: int @index(int) @upsert .
<name>: string @index(hash, trigram) .
<type>: string @index(hash) .
<referent>: string .
<referents>: uid @reverse .
We insert following datas :
{
set {
_:class <referents> _:r1 .
_:r1 <referent> "" .
_:r1 <name> "Referent1" .
_:r1 <type> "Referent" .
_:r1 <xid> "1" .
_:class <referents> _:r2 .
_:r2 <referent> "" .
_:r2 <name> "Referent2" .
_:r2 <type> "Referent" .
_:r2 <xid> "2" .
}
}
We can query on datas created :
{
node(func: uid(0x2711)) {
uid
name
type
xid
}
}
{
"extensions": {
"server_latency": {
"parsing_ns": 4532,
"processing_ns": 6298463,
"encoding_ns": 409192
},
"txn": {
"start_ts": 418482
}
},
"data": {
"node": [
{
"uid": "0x2711",
"name": "Referent1",
"type": "Referent",
"xid": 1
}
]
}
}
We can delete links between referent and <referents>
{
delete {
<0x2713> <referents> <0x2711> .
<0x2713> <referents> <0x2712> .
}
}
{
"data": {
"code": "Success",
"message": "Done",
"uids": {}
},
"extensions": {
"server_latency": {
"parsing_ns": 6117,
"processing_ns": 23014792
},
"txn": {
"start_ts": 420585,
"commit_ts": 420586,
"preds": [
"1-referents"
]
}
}
}
But we can’t remove referent nodes <0x2711> & <0x2712>, nor delete their predicates (referent, name, type & xid)
We try following formats :
{
delete {
<0x2711> * * .
}
}
{
"delete": [
{ "uid": "0x2711" }
]
}
{
delete {
<0x2711> <name> * .
}
}
{
"delete": [
{ "uid": "0x2711", "name": null }
]
}
We have following error :
{
"errors": [
{
"code": "ErrorInvalidRequest",
"message": "Please use * with delete operation for non-list type: [_predicate_]"
}
],
"data": null
}
We try other format :
{
delete {
<0x2711> <name> "" .
}
}
We have following error :
{
"errors": [
{
"code": "ErrorInvalidRequest",
"message": "Please use * with delete operation for non-list type: [name]"
}
],
"data": null
}
What is wrong in our process?
Delete a node & a predicate is a requirement to adopt DGraph.