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

mong

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mong

Lightweight models for mongodb objects

2.0.2
latest
72

Supply Chain Security

100

Vulnerability

81

Quality

76

Maintenance

100

License

Deprecated

Maintenance

The maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.

Found 1 instance in 1 package

Unpopular package

Quality

This package is not very popular.

Found 1 instance in 1 package

Dependencies have 5 high and critical alerts.

Critical CVE, Socket optimized override available, and High CVE

Version published
Maintainers
1
Created

mong

NPM Version Build Status Coverage Status NPM Downloads License

Simple models for mongodb objects.

npm install mong

Creating a collection class

var db = require('mong').create();

var User = module.exports = db.model('users');

User.prototype.getFullName = function () {
  return this.firstName + ' ' + this.lastName;
};

Then you can use the model:

db.connect('mongodb://localhost/mydatabase', function (err) {
  if (err) throw err;

  User.findOne({firstName: 'Anthony'}, function (err, doc) {
    console.log(doc.getFullName());
    doc.update({$inc: {count: 1}});
  });

  User
  .find()
  .on('data', function (user) {
    console.log(user.getFullName());
  })
  .on('end', function () {
    console.log('Node streams are cool!');
  });
});

FAQs

Package last updated on 18 Oct 2015

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