You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mongodb-moment

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-moment

Make the mongodb node driver able to serialize moment.js objects

1.0.1
Source
npmnpm
Version published
Weekly downloads
94
123.81%
Maintainers
1
Weekly downloads
 
Created
Source

mongodb-moment

Make the mongodb node driver able to serialize moment.js objects.

Build Status

example


    const moment = require('moment');
    require('mongodb-moment')(moment);

    co(function*() {
      const id = new mongodb.ObjectId();
      yield db.collection('test').
        insertOne({ _id: id, createdAt: moment.utc('2011-06-01') });

      const res = yield db.collection('test').findOne();
      assert.deepEqual(res, { _id: id, createdAt: new Date('2011-06-01') });
    })
  

Keywords

mongodb

FAQs

Package last updated on 01 Apr 2016

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