Skip to content

jcblw/node-mongs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongs Build Status

Greenkeeper badge

a tool to stream mongodb data so it can be piped to things like dat

Install

$ npm install mongs -g

Usage

CLI

$ mongs -d databaseName -c collectionName [ -h host -p port ]

you can pipe the results to dat

$ mongs -d project -c geopoints | dat import --json --primary=_id  

you can also access remote urls and even authenticate

$ mongs --user test --password 1234 -h hello.example.com -p 49153 -d sample -c locations

Javascript Api

Right now, mongs just exports a stream of data

var mongs = require( 'mongs' ),
    stream = mongs({ 
      db: 'mongs-test',
      collection: 'mongs'
    });

  stream.pipe( fooTranform ).pipe( bar );

The api is the same as the CLI

Api

Both the command line and javascript api takes these inputs.

-d, --db          - required the database name
-c, --collection  - required the collection in the database
-p, --port        - optional port of mongo database
-h, --host        - optional host of mongo database
-u, --user        - optional user for auth to mongo database
-a, --password    - optional password for auth to mongo database

The javascript api takes the expanded versions of these flags.

Wishlist

  • better intergration into dat
  • stream data into mongodb

About

A simple command line tool to stream out mongodb data in a way that can be consume by dat

Resources

Stars

Watchers

Forks

Packages

No packages published