You are currently browsing legacy 4.1 version of documentation. Click here to switch to the newest 4.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Operations: Attachments: How to Delete an Attachment

This operation is used to delete an attachment from a document.

Syntax

DeleteAttachmentOperation(String documentId, String name)

DeleteAttachmentOperation(String documentId, String name, String changeVector)

Parameters
documentId String ID of a document containing an attachment
name String Name of an attachment
changeVector String Entity changeVector, used for concurrency checks (null to skip check)

Example

store.operations().send(
    new DeleteAttachmentOperation("orders/1-A", "invoice.pdf"));