Skip to main content

Deleting Data

Delete Subject#

To delete/retract an entire subject, use the _id key along with only "_action": "delete". This deletes (retracts) the subject all predicates. In addition, all of the references for that subject anywhere in the ledger are also retracted.

[  {    "_id": ["person/handle", "zsmith"],    "_action": "delete"  }]

Delete Specific Predicates#

To delete only specific predicate-objects within an subject, specify the key/value combinations.

You can delete (retract) a single predicate by setting the value of _id to a two-tuple of the predicate and predicate value, and then setting the predicate to null. "_action": "delete" is inferred.

[  {    "_id": ["person/handle", "jdoe"],    "age": null  }]

Delete Specific Multi Predicates#

To delete (retract) only a single object from a multi predicate, specify the predicate-object, and add "_action": "delete"

For example, to delete just the number, 98, from ["person/handle", "jdoe"]'s favorite numbers, we would issue:

[  {    "_id": ["person/handle", "jdoe"],    "favNums": [98],    "_action": "delete"  }]

To delete all of ["person/handle", "jdoe"]'s favorite numbers, we would issue:

[  {    "_id": ["person/handle", "jdoe"],    "favNums": null  }]