congress-mongodb
Table of contents
Dependencies
CLI
- congress
- congress-legislators
- MongoDB^3.2.0
- 4GB RAM+ to sync
Integration
- mongoose^4.0.0
Install
# CLI yarn global add congress-mongodbcongress -hcongress fetch -hcongress sync -h # Integration yarn add congress-mongodb./node_modules/.bin/congress -h./node_modules/.bin/congress-fetch -h./node_modules/.bin/congress-sync -h
Use
Command - fetch
Download sitemaps, json, etc.
congress fetchcongress fetch -d tmp
Command - sync
Import data from files to mongodb in structured format
congress synccongress sync -d tmpcongress sync -d tmp -u mongodb://localhost:27017/my-db # or $MONGODB_URI
Integration - connection
Integrate mongoose models in your app
;; // pass uri or set $MONGODB_URIcongress ;
Integration - models
Integrate mongoose models in your app with an existing connection
;;const db = congress; dbMember
Develop
npm link # init project and link for development congress fetch # download data congress sync # import to mongodb (default mongodb://localhost:27017/congress)
Todo
- Implement options for more specific fetch/sync
- Implement remove command
License
MIT