Attribute Macro junobuild_macros::on_delete_doc

source ·
#[on_delete_doc]
Expand description

The on_delete_doc function is a procedural macro attribute for hooking into the OnDeleteDoc event. It allows you to define custom logic to be executed when a document is deleted.

Example:

#[on_delete_doc]
async fn on_delete_doc(context: OnDeleteDocContext) -> Result<(), String> {
    // Your hook logic here
}

When no attributes are provided, the hook is triggered for any document set within any collection. You can scope the events to a particular list of collections.

Example:

#[on_delete_doc(collections = ["demo"])]
async fn on_delete_doc(context: OnDeleteDocContext) -> Result<(), String> {
    // Your hook logic here
}

The attributes accept a list of comma-separated collections. If the attribute array is left empty, the hook will never be called.