junobuild_satellite

Function get_doc_store

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

Get a document from a collection’s store.

This function retrieves a document from a collection’s store based on the specified parameters. It returns a Result<Option<Doc>, String> where Ok(Some(Doc)) indicates a successfully retrieved document, Ok(None) represents no document found, or an error message as Err(String) if retrieval encounters issues.

§Parameters

  • caller: The UserId representing the caller requesting the document.
  • collection: A CollectionKey representing the collection from which to retrieve the document.
  • key: A Key identifying the document to be retrieved.

§Returns

  • Ok(Some(Doc)): Indicates successful retrieval of a document.
  • Ok(None): Indicates no document found for the specified key.
  • Err(String): An error message if retrieval fails.

This function allows you to securely retrieve a document from a Juno collection’s store.