I can delete edge predicate but not the node itself with curl... json... mutate?commitNow=true

I can delete edge predicates:

POST http://{{host}}/mutate?commitNow=true
Content-Type: application/json

{
    "delete": [
        {
            "uid": "0x56",
            "follows": [
                {
                    "uid": "0x55"
                }
            ]
        }
    ]
}

But not the node itself:

POST http://{{host}}/mutate?commitNow=true
Content-Type: application/json

{
    "delete": [
        {
            "uid": "0x56"
        }
    ]
}

Using RDF is working:

POST http://{{host}}/mutate?commitNow=true
Content-Type: application/rdf

{
delete {
   <0x56> <name> * .
  }
}

Have you set the Type Schema? https://docs.dgraph.io/query-language/#type-system

The node was created with:

POST http://{{host}}/mutate?commitNow=true
Content-Type: application/json

{
    "set": [
    {
        "name": "Alice"
    },
    {
        "name": "Bob"
    }
    ]
}

No I did not specify the schema myself, it was done by dgraph - I dont know the name for this process where dgraph automatically creates the node and the schema?

The schema is: Preedicate: name, Type: string, and no Indices.

Do this:

curl -X POST localhost:8080/alter -d \
'name: string @index(term) .
  type Person {
	 name: String
  }'

But add the type in the mutation

{
    "set": [
    {
        "name": "Alice",
        "dgraph.type": "Person"
    },
    {
        "name": "Bob",
        "dgraph.type": "Person"
    }
    ]
}

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