# Please use \* with delete operation for non-list type: \[\_predicate\_\]

**URL:** <https://discuss.dgraph.io/t/please-use-with-delete-operation-for-non-list-type-predicate/8155>\
**Category:** Dgraph Clients\
**Tags:** untagged, dgraph-js\
**Created:** [May 4, 2018, 2:59pm UTC](https://discuss.dgraph.io/t/please-use-with-delete-operation-for-non-list-type-predicate/8155 "2018-05-04T14:59:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [May 4, 2018, 2:59pm UTC](https://discuss.dgraph.io/t/please-use-with-delete-operation-for-non-list-type-predicate/8155/1 "2018-05-04T14:59:23Z")

</div>

**Moved from GitHub [dgraph-js/34](https://github.com/dgraph-io/dgraph-js/issues/34)**

_Posted by_ [lazharichir](https://github.com/lazharichir):

Hello - quick question!

```auto
mu.setDeleteJson([{ 'topic.external.wikidata': null, uid: '0x9c671a' }]);

```

Returns:

```auto
2 UNKNOWN: Please use * with delete operation for non-list type: [_predicate_]

```

The predicate `topic.external.wikidata` is a `int`, non-list.

Anything I am missing? I want to delete the predicate `topic.external.wikidata` for the `uid` specified.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [May 7, 2018, 5:31am UTC](https://discuss.dgraph.io/t/please-use-with-delete-operation-for-non-list-type-predicate/8155/2 "2018-05-07T05:31:33Z")

</div>

[gpahal](https://github.com/gpahal) _commented_ :

It’s working with this example.

```auto
const dgraph = require("dgraph-js");

async function main() {
    const clientStub = new dgraph.DgraphClientStub("localhost:9080");
    const client = new dgraph.DgraphClient(clientStub);

    console.log("DROP ALL");
    let op = new dgraph.Operation();
    op.setDropAll(true);
    await client.alter(op);

    console.log("SET SCHEMA");
    const schema = `
        name: string @index(term) .
        topic.external.wikidata: int .
    `;
    op = new dgraph.Operation();
    op.setSchema(schema);
    await client.alter(op);

    console.log("CREATE DATA");
    let txn = client.newTxn();
    let uid;
    try {
        const mu = new dgraph.Mutation();
        mu.setSetNquads(`
            <_:a> <name> "a" .
            <_:a> <topic.external.wikidata> "1" .
            <_:b> <name> "b" .
            <_:b> <topic.external.wikidata> "2" .
        `);
        const assigned = await txn.mutate(mu);
        await txn.commit();
        uid = assigned.getUidsMap().get("b")
    } finally {
        await txn.discard();
    }

    console.log("QUERY DATA");
    let query = `{
        all(func: has(name)) {
            uid
            name
            topic.external.wikidata
        }
    }`;
    let res = await client.newTxn().query(query);
    let ppl = res.getJson();
    console.log(`BEFORE:\nNumber of people: ${ppl.all.length}`);
    console.log(`People: ${JSON.stringify(ppl)}\n`);

    console.log("DELETE DATA");
    txn = client.newTxn();
    try {
        const mu = new dgraph.Mutation();
        mu.setDeleteJson([{ uid: uid, "topic.external.wikidata": null }]);
        await txn.mutate(mu);
        await txn.commit();
    } finally {
        await txn.discard();
    }

    console.log("QUERY DATA");
    query = `{
        all(func: has(name)) {
            uid
            name
            topic.external.wikidata
        }
    }`;
    res = await client.newTxn().query(query);
    ppl = res.getJson();
    console.log(`AFTER:\nNumber of people: ${ppl.all.length}`);
    console.log(`People: ${JSON.stringify(ppl)}`);

    clientStub.close();
}

main().then(() => {
    console.log("DONE!");
}).catch((e) => {
    console.log("ERROR: ", e);
});

```

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [May 7, 2018, 5:32am UTC](https://discuss.dgraph.io/t/please-use-with-delete-operation-for-non-list-type-predicate/8155/3 "2018-05-07T05:32:57Z")

</div>

[gpahal](https://github.com/gpahal) _commented_ :

Can you share a bit more of your code because the error seems to indicate predicate name `_predicate_`

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [July 11, 2020, 4:15am UTC](https://discuss.dgraph.io/t/please-use-with-delete-operation-for-non-list-type-predicate/8155/4 "2020-07-11T04:15:14Z")

</div>


