🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

json2mongo

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2mongo

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

2.0.0
latest
Source
npm
Version published
Weekly downloads
1.3K
-22.68%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

mongo

FAQs

Package last updated on 20 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts