Skip to content

A MongoDB Extended JSON conversion utility which converts Strict Mode syntax to JavaScript Mode

License

Notifications You must be signed in to change notification settings

watson/json2mongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json2mongo

This is a MongoDB Extended JSON convertion utility which converts Strict Mode syntax to JavaScript Mode.

Build status js-standard-style

Installation

npm install json2mongo --save

Example usage

var json2mongo = require('json2mongo');

var query = {
  created: { $date: '2013-01-01T00:00:00.000Z' },
  foo: { $undefined: true },
  bar: { $regex: '[0-9]' },
  baz: { $regex: '[a-z]', $options: 'i' }
};

json2mongo(query); // {
                   //   created: new Date('2013-01-01T00:00:00.000Z'),
                   //   foo: undefined,
                   //   bar: /[0-9]/,
                   //   baz: /[a-z]/i
                   // }

License

MIT

About

A MongoDB Extended JSON conversion utility which converts Strict Mode syntax to JavaScript Mode

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •