a tool to stream mongodb data so it can be piped to things like dat
$ npm install mongs -g
$ 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
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
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.
- better intergration into dat
- stream data into mongodb