pub fn delete(&mut self, docid: &str, batch: &mut Batch) -> Result<bool, Error> {
        if batch.id_str_in_batch.contains(docid) {
            // oops use trying to delete a doc that's in the batch. Can't happen,
            return Err(Error::Write(
                "Attempt to delete doc with same _id added earlier".to_string(),
            ));
        }
        if let Some((seq, key_values)) = self.gather_doc_fields(docid)? {
            let mut shredder = Shredder::new();
            shredder.delete_existing_doc(docid, seq, key_values, &mut batch.wb)?;
            batch.id_str_in_batch.insert(docid.to_string());
            Ok(true)
        } else {
            Ok(false)
        }
    }
/// Returns Ok(true) if the document was found and deleted, Ok(false) if it could not be found
Returns Ok(true) if the document was found and deleted, Ok(false) if it could not be found
Returns Ok ( true ) if the document was found and deleted Ok ( false ) if it could not be found
pub fn delete(&mut self, docid: &str, batch: &mut Batch) -> Result<bool, Error> {
        if batch.id_str_in_batch.contains(docid) {
            // oops use trying to delete a doc that's in the batch. Can't happen,
            return Err(Error::Write(
                "Attempt to delete doc with same _id added earlier".to_string(),
            ));
        }
        if let Some((seq, key_values)) = self.gather_doc_fields(docid)? {
            let mut shredder = Shredder::new();
            shredder.delete_existing_doc(docid, seq, key_values, &mut batch.wb)?;
            batch.id_str_in_batch.insert(docid.to_string());
            Ok(true)
        } else {
            Ok(false)
        }
    }
pub fn delete ( & mut self , docid : & str , batch : & mut Batch ) -> Result < bool , Error > { if batch . id_str_in_batch . contains ( docid ) { // oops use trying to delete a doc that's in the batch. Can't happen, return Err ( Error :: Write ( " " . to_string ( ) , ) ) ; } if let Some ( ( seq , key_values ) ) = self . gather_doc_fields ( docid ) ? { let mut shredder = Shredder :: new ( ) ; shredder . delete_existing_doc ( docid , seq , key_values , & mut batch . wb ) ? ; batch . id_str_in_batch . insert ( docid . to_string ( ) ) ; Ok ( true ) } else { Ok ( false ) } }
Returns Ok(true) if the document was found and deleted, Ok(false) if it could not be found
Returns Ok ( true ) if the document was found and deleted Ok ( false ) if it could not be found
&mut self
docid
&str
batch
&mut Batch
&mut self
docid
&str
batch
&mut Batch