Crate mongoloid [] [src]

mongoloid

The 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. mongoloid will: * Infer the type of database to build from the current directory name (dail, assembly, or westminster) * 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

Modules

util

Enums

ElectionDatabase

Functions

create_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 generated. Note: the current directory name must be that of a supported election.