/// Resets the category id in all entries to the default value.
Resets the category id in all entries to the default value.
Resets the category id in all entries to the default value .
pub fn reset_category_in_entries(&self, entries: &JsValue) -> Promise {
        // Parse entries into array and later vec
        let mut entries_parsed = entries.into_serde::<Value>().unwrap();
        let entries_vec = entries_parsed.as_array_mut().unwrap();
        // Set id for category to default value on every entry
        for entry in &mut *entries_vec {
            entry["catID"] = Value::String(String::from("0"));
        }
        // Build query and perform update
        let query = JsValue::from_serde(&entries_vec).unwrap();
        let action = JsFuture::from(self.bulk_docs(&query));
        future_to_promise(async move {
            action.await
        })
    }
pub fn reset_category_in_entries ( & self , entries : & JsValue ) -> Promise { // Parse entries into array and later vec let mut entries_parsed = entries . into_serde :: < Value > ( ) . unwrap ( ) ; let entries_vec = entries_parsed . as_array_mut ( ) . unwrap ( ) ; // Set id for category to default value on every entry for entry in & mut * entries_vec { entry [ " " ] = Value :: String ( String :: from ( " " ) ) ; } // Build query and perform update let query = JsValue :: from_serde ( & entries_vec ) . unwrap ( ) ; let action = JsFuture :: from ( self . bulk_docs ( & query ) ) ; future_to_promise ( async move { action . await } ) }
Resets the category id in all entries to the default value.
Resets the category id in all entries to the default value .
&self
entries
&JsValue