Skip to contents

This function merges preprocessed legacy landings data with ongoing landings data from separate MongoDB collections. It combines the datasets, performs minimal transformations, and uploads the merged result to a new MongoDB collection.

Usage

merge_landings(log_threshold = logger::DEBUG)

Arguments

log_threshold

Logging threshold level (default: 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:

  1. Pulls preprocessed legacy data from the legacy preprocessed MongoDB collection.

  2. Pulls preprocessed ongoing data from the ongoing preprocessed MongoDB collection.

  3. Combines the two datasets using dplyr::bind_rows(), adding a 'version' column to distinguish the sources.

  4. Selects and orders relevant columns for the final merged dataset.

  5. Uploads the merged data to a new MongoDB collection for merged landings data.

Note

This function requires a configuration file to be present and readable by the 'read_config' function, which should provide MongoDB connection details.

Examples

if (FALSE) { # \dontrun{
merge_landings()
} # }