Skip to main content

seed

Function seed 

Source
pub async fn seed(
    uri: &str,
    db_name: &str,
    statements: &[&str],
) -> Result<u64, StorageError>
Expand description

Connect and run a batch of Mongo command documents (JSON strings, e.g. {"insert":"products","documents":[{...}]}), in order, returning the total affected document count. Self-contained — no set_storage needed. Used by adminx seed and by app startup code.