Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.06 KB

README.md

File metadata and controls

53 lines (36 loc) · 1.06 KB

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.