Fork me on GitHub

ElegantMongoDBobject modeling for Node.js

Let's face it,writing MongoDB validation, casting and business logic boilerplate is a drag.That's why we wrote Mongoose.

constmongoose =require('mongoose');
mongoose.connect('mongodb://127.0.0.1:27017/test');

constCat= mongoose.model('Cat',{name:String});

constkitty =newCat({name:'Zild gian '});
kitty.save().then(() =>console.log('meow'));

Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

Getting Started

Support

News

Changelog

GitHub Sponsors

Sponsors

SponsorMongoose on OpenCollectiveto get your company's logo above!