Skip to contents

This function retrieves validated landings data from a MongoDB collection, selects specific columns, and uploads the selected data to another MongoDB collection for use in summary applications.

Usage

export_landings(log_threshold = logger::DEBUG)

Arguments

log_threshold

Logging threshold level (default: logger::DEBUG)

Value

This function does not return a value. It processes the data and uploads the selected fields to a MongoDB collection in the app database.

Details

The function performs the following main operations:

  1. Retrieves validated landings data from the validated MongoDB collection.

  2. Standardizes the 'gillnets' list column.

  3. Selects specific columns from the validated data, including:

    • Basic information (form name, submission ID, survey ID, landing date)

    • Location data (sample district, landing site, latitude, longitude)

    • Fishing details (number of fishers, trip length, gear)

    • Catch information (usage, taxon, price, weight, price per kg in USD)

  4. Uploads the selected data to the summary MongoDB collection in the app database.

Note

This function requires a configuration file to be present and readable by the 'read_config' function, which should provide MongoDB connection details and collection names for both the pipeline and app databases.

Examples

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