# easymongoosedb

> Easily setup a mongo database connection using Mongoose

Latest version **0.1.1** (published 2014-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install easymongoosedb
pnpm add easymongoosedb
yarn add easymongoosedb
bun add easymongoosedb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2014-08-07 |
| First published | 2014-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| Author | Nathan Oehlman |
| Maintainers | nathanoehlman |

## Links

- npm: https://www.npmjs.com/package/easymongoosedb
- npm.io page: https://npm.io/package/easymongoosedb

## Dependencies (3)

- [async](https://npm.io/package/async.md) ~0.1.22
- [debug](https://npm.io/package/debug.md) ~0.7.2
- [lodash](https://npm.io/package/lodash.md) ~2.4.1

## Recent versions

- 0.1.1 (latest) — 2014-08-07
- 0.1.0 — 2014-08-07

## README

# EasyMongooseDB

EasyMongooseDB takes a lot of the make work around quickly setting up a connection to a MongoDB database with Mongoose, as well as providing helpful functions around models and schema creation.

## Installation

```
npm install easymongoosedb
```

## Example Usage

### Connection to a database

```
var easydb = require('easymongoosedb');

var db = easydb({
	url: 'mongodb://127.0.0.1:27017/testdb', // Path to your database
	type: 'single', // Can be set/single
	modelsDir: path.join(__dirname, 'schemas') // Path to the schemas
});

db.connect(function(err) {
	
});

```

### Getting a model

```
// Async
db.getModel('user', function(err, User) {
	User.find(...);
});

// Get many models
db.getModels(['user', 'invoices'], function(err, User, Invoices) {
	
});

// Sync
var User = db.getModelSync('User');
```

### Namespacing

EasyMongooseDB provides the ability to created use a single schema to create many namespaced models (useful for creating instanced collections).

TODO - Add details

## License
EasyMongooseDB is distributed under an [MIT License](http://www.opensource.org/licenses/mit-license.php)_

---
_Source: https://npm.io/package/easymongoosedb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
