Skip to content

apolloyang2017/pino-mongodb

 
 

Repository files navigation

pino-mongodb

Standard - JavaScript Style Guide

Insert JSON from stdin into MongoDB

This project is part of the pino logger family, however you can use it to parse and insert any JSON into the mongo.

Install

npm i -g https://github.com/apolloyang2017/pino-mongodb.git

Get started

echo '{"name": "Viktor"}' | pino-mongodb [options] [mongo-url]
cat many.logs | pino-mongodb [options] [mongo-url]
node ./app.js | pino-mongodb [options] [mongo-url]

Usage

Usage: pino-mongodb [options] [mongo-url]

Insert JSON from stdin into MongoDB

Options:
  -V, --version            output the version number
  -c, --collection <name>  database collection (default: "logs")
  -o, --stdout             output inserted documents into stdout
  -e, --errors             output insertion errors into stderr
  -h, --help               output usage information

Tests

npm t

License

Licensed under MIT.

About

🌲 Insert JSON from stdin into MongoDB

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%