Ingest Survey landings from Kobotoolbox into MongoDB
ingest_landings.Rd
This function downloads survey landings data from Kobotoolbox for multiple assets, processes them into a tidy format,
and uploads the processed data to a MongoDB database. The function logs the progress at various stages.
Configuration parameters such as the URL, asset IDs, usernames, and passwords are read from a configuration file
using read_config()
.
Usage
ingest_landings(log_threshold = logger::DEBUG)
Arguments
- log_threshold
The (standard Apache log4j) log level used as a threshold for the logging infrastructure. See logger::log_levels for more details. Default is
logger::DEBUG
.
Value
This function performs side effects (downloads data, processes it, and uploads to MongoDB) and does not return a value.
Details
The function performs the following steps:
Sets the logging threshold to the specified level.
Reads configuration parameters using
read_config()
.Sets up a parallel processing plan using
future::plan()
.Downloads and processes data for each asset ID using
process_asset()
.Renames specific columns for consistency across different forms.
Uploads the processed data to a MongoDB collection using
mdb_collection_push()
.