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.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

mongodb-moment

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

Build Status

It 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') });
  // acquit:ignore:start
  done();
  // acquit:ignore:end
})
// acquit:ignore:start
.catch(done);
// acquit:ignore:end

Keywords

mongodb

FAQs

Package last updated on 06 Dec 2018

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