New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

congress-mongodb

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

congress-mongodb

Integrate congress data using MongoDB

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

congress-mongodb

npm version dependencies Status peerDependencies Status GitHub issues GitHub stars GitHub license

Table of contents

Dependencies

CLI
Integration

Install

# CLI
yarn global add congress-mongodb
congress -h
congress fetch -h
congress 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 fetch
congress fetch -d tmp
Command - sync

Import data from files to mongodb in structured format

congress sync
congress sync -d tmp
congress sync -d tmp -u mongodb://localhost:27017/my-db # or $MONGODB_URI
Integration - connection

Integrate mongoose models in your app

import congress from 'congress-mongodb';
import mongoose from 'mongoose';

// pass uri or set $MONGODB_URI
congress.connect(mongoose, uri)
  .then(db => {

    // current members
    db.Member.find({current: true})
      .then(m => {
        console.log(m.join('\n'));
      });
  });
Integration - models

Integrate mongoose models in your app with an existing connection

import congress from 'congress-mongodb';
import mongoose from 'mongoose';
const db = congress.models(mongoose);

db.Member.find({current: true, chamber: 'senate'})
  .skip(0)
  .limit(50)
  .exec()
  .then(senate => {
    console.log(`Current senators:\n${senate.join('\n')}`)
  })

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

Keywords

FAQs

Package last updated on 20 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc