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

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Attachments: Deleting Attachments

The method session.advanced.attachments.delete() is used to remove an attachment from a document.


session.advanced.attachments.delete(documentId, name);

session.advanced.attachments.delete(entity, name);


const session = store.openSession();
const album = await session.load("albums/1");
session.advanced.attachments.delete(album, "001.jpg");

session.advanced.attachments.delete("albums/1", "002.jpg");

await session.saveChanges();