This PR implements a new Refs API, which can be (arguably counter-intuitively) used to delete documents.
Notable changes:
CreateRef lets you create a Ref blob for a given account + path. Currently only tombstone targets are implemented.
GetRef lets you get an existing Ref. Not sure why would you want it, but it's there.
GetDocument has a new ignore_deleted flag, which can be used to get the latest version of the document even if it's deleted.
ListDocuments has a new deleted_only flag which lets only list deleted documents in a given account.
Getting documents with exact version works regardless of the deletion.
So, if you'd want to delete a document, you'd create a tombstone Ref. This will make the document disappear from the list request (unless deleted_only is specified). A get request would return an error with FailedPrecondition GRPC error code, unless ignore_deleted flag is specified.
I still need to test if it will let you publish something again on the same path after deletion or not.
This PR implements a new Refs API, which can be (arguably counter-intuitively) used to delete documents.
Notable changes:
CreateRef
lets you create a Ref blob for a given account + path. Currently only tombstone targets are implemented.GetRef
lets you get an existing Ref. Not sure why would you want it, but it's there.GetDocument
has a newignore_deleted
flag, which can be used to get the latest version of the document even if it's deleted.ListDocuments
has a newdeleted_only
flag which lets only list deleted documents in a given account.So, if you'd want to delete a document, you'd create a tombstone Ref. This will make the document disappear from the list request (unless
deleted_only
is specified). A get request would return an error withFailedPrecondition
GRPC error code, unlessignore_deleted
flag is specified.I still need to test if it will let you publish something again on the same path after deletion or not.