pub fn set_doc_store(
caller: UserId,
collection: CollectionKey,
key: Key,
value: SetDoc,
) -> Result<DocContext<DocUpsert>, String>
Expand description
Insert Set a document in a collection’s store.
This function sets a document in a collection’s store based on the specified parameters.
It returns a Result<DocContext<DocUpsert>, String>
where Ok(DocContext)
indicates successful
insertion or update of the document, or an error message as Err(String)
if the operation encounters
issues.
§Parameters
caller
: TheUserId
representing the caller initiating the operation.collection
: ACollectionKey
representing the collection in which to set the document.key
: AKey
identifying the document to be set.value
: An instance ofSetDoc
representing the document to be inserted or updated.
§Returns
Ok(DocContext<DocUpsert>)
: Indicates successful insertion or update of the document.Err(String)
: An error message if the operation fails.
This function allows you to securely insert or update documents in a Juno collection’s store.