Preprocess Legacy Landings Data
preprocess_legacy_landings.Rd
This function imports, preprocesses, and cleans legacy landings data from a MongoDB collection. It performs various data cleaning and transformation operations, including column renaming, removal of unnecessary columns, generation of unique identifiers, and data type conversions. The processed data is then uploaded back to MongoDB.
Usage
preprocess_legacy_landings(log_threshold = logger::DEBUG)
Value
This function does not return a value. Instead, it processes the data and uploads the result to a MongoDB collection in the pipeline database.
Details
The function performs the following main operations:
Pulls raw data from the raw data MongoDB collection.
Removes several unnecessary columns.
Renames columns for clarity (e.g., 'site' to 'landing_site').
Generates unique 'survey_id' and 'catch_id' fields.
Converts several string fields to lowercase.
Cleans catch names using a separate function 'clean_catch_names'.
Uploads the processed data to the preprocessed MongoDB collection.