mongoloid crate exposes a basic API with which to build a Toghcháin
Éireann database in MongoDB. This is called through
main.rs when the
program is executed.
- Infer the type of database to build from the current directory name (
- Find the
constituency directory and walk all its subdirectories
- For each direcory, walk all its
.json files and serialise them as native structs in Rust
- Insert all data into the new database
Create a new database in MongoDB. If
db_name contains a value, it will be
be used to name the database, otherwise an unique name will be automatically
Note: the current directory name must be that of a supported election.