You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mod.rs
    path of file: ./repos/spyglass/crates/spyglass/src/documents
    
    the code of the file until where you have to start completion: use chrono::Utc;
use entities::{
    models::{
        crawl_queue,
        indexed_document::{self, find_by_doc_ids},
        tag::{self, TagPair},
    },
    sea_orm::{ActiveModelTrait, DatabaseConnection},
    BATCH_SIZE,
};
use shared::config::LensConfig;
use spyglass_plugin::TagModification;
use std::{collecti
    
pub async fn delete_documents_by_uri(state: &AppState, uri: Vec<String>) {
    log::info!("Deleting {} documents", uri.len());

    // Delete from crawl queue
    if let Err(error) = crawl_queue::delete_many_by_url(&state.db, &uri).await {
        log::warn!("Unable to delete from crawl_queue: {:?}", error);
    }

    // find all documents that already exist with that url
    for chunk in uri.chunks(BATCH_SIZE) {
        let existing: Vec<indexed_document::Model> = indexed_document::Entity::find()
            .filter(indexed_document::Column::Url.is_in(chunk.to_vec()))
            .all(&state.db)
            .await
            .unwrap_or_default();

        // build a hash map of Url to the doc id
        let mut id_map = HashMap::new();
        for model in &existing {
            id_map.insert(model.url.to_string(), model.doc_id.clone());
        }

        // build a list of doc ids to delete from the index
        let doc_id_list = id_map
            .values()
            .map(|x| x.to_owned())
            .collect::<Vec<String>>();

        if let Err(err) = state.index.delete_many_by_id(&doc_id_list).await {
            log::warn!("Unable to delete_many_by_id: {err}")
        }

        // now that the documents are deleted delete from the queue
        if let Err(error) = indexed_document::delete_many_by_url(&state.db, chunk).await {
            log::warn!("Error deleting for indexed document store {:?}", error);
        }

        log::info!(
            "chunk: deleted {} ({}) docs from index",
            chunk.len(),
            existing.len()
        );
    }
}