mongodb-log2ejson

0.1.3 • Public • Published

mongodb-log2ejson

This little helper module converts MongoDB native types printed in log files into extended JSON strict format.

When MongoDB (version 2.8.0 and below) prints certain types to log files (e.g. for slow queries), it uses a custom format that is neither strict eJSON nor shell syntax. This module parses the different types and converts them to strict eJSON.

See also ticket SERVER-16618 in MongoDB's Jira.

Usage

 
var parser = require('mongodb-log2ejson');
 
var parsed = parser('{ created: new Date(1388534400000) }');
console.log(parsed);
 
// output: { created: { "$date": "2014-01-01T00:00:00.000Z" } }
 

Test

run mocha.

Dependents (1)

Package Sidebar

Install

npm i mongodb-log2ejson

Weekly Downloads

5

Version

0.1.3

License

MIT

Last publish

Collaborators

  • orechova
  • himanshusinghs
  • c-buckingham
  • mongo-j
  • mabaasit
  • alexander_schroll
  • chuck.kalmanek
  • mongodb-js-user
  • rueckstiess
  • durran
  • lerouxb
  • fredtruman
  • mbroadst
  • hswolff
  • satyasinha
  • matt_d_rat
  • rhysm
  • tomhollander
  • alena.khineika
  • jeff-allen-mongo
  • mmarcon
  • jonathan.balsano
  • mongodb-build
  • jack.weir
  • stennie
  • mcasimir
  • kristina.stefano
  • jarjee
  • shaketbaby
  • devtoolsbot
  • addaleax
  • gribnoysup
  • mutukrish