Add custom field sync gateway delete action

Hi,
is there a way to add custom field during deletion with sync gateway?
My problem is if i delete a document, the document become:

{
      _deleted: true,
     _id: 'id',
     _rev: '1-f71486306fb077e506e70be78dfc1e01' 
}

I need to keep the “type” field, so my document should be like this:

{
      _deleted: true,
     _id: 'id',
     _rev: '1-f71486306fb077e506e70be78dfc1e01' ,
     type: "type"
}

Is it possible?

Thanks in advance

A deletion is just a revision with a "_deleted":true property, so you can delete a document by sending a PUT whose body includes such a property. That way you can include any other properties you want.

1 Like