junobuild_satellite

Function delete_doc_store

Source
pub fn delete_doc_store(
    caller: UserId,
    collection: CollectionKey,
    key: Key,
    value: DelDoc,
) -> Result<DocContext<Option<Doc>>, String>
Expand description

Delete Delete a document from a collection’s store.

This function deletes a document from a collection’s store based on the specified parameters. It returns a Result with Ok(DocContext<Option<Doc>>) on success, containing information about the deleted document, or an error message as Err(String) if the deletion encounters issues.

§Parameters

  • caller: The UserId representing the caller initiating the deletion.
  • collection: A CollectionKey representing the collection from which to delete the document.
  • key: A Key identifying the document to be deleted.
  • value: An instance of DelDoc representing the deletion action.

§Returns

  • Ok(DocContext<Option<Doc>>):
    • key: The Key of the deleted document.
    • collection: The CollectionKey from which the document was deleted.
    • data: An Option<Doc> representing the deleted document data, if available.
  • Err(String): An error message if the deletion operation fails.

This function allows you to securely delete documents from a Juno collection’s store, returning relevant context information or error messages.