# node-mongoose-repository

> Model repository using node and mongoose

Latest version **0.0.20** (published 2021-09-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install node-mongoose-repository
pnpm add node-mongoose-repository
yarn add node-mongoose-repository
bun add node-mongoose-repository
```

## 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.0.20 |
| Published | 2021-09-26 |
| First published | 2020-03-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 18.4 KB |
| Known vulnerabilities | 0 (+11 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Lucas Limão |
| Maintainers | lucas.limao |
| Keywords | node, nodejs, mongoose, repository |

## Links

- npm: https://www.npmjs.com/package/node-mongoose-repository
- Repository: https://github.com/lucaslimao/node-mongoose-repository
- Homepage: https://github.com/lucaslimao/node-mongoose-repository#readme
- Issues: https://github.com/lucaslimao/node-mongoose-repository/issues
- npm.io page: https://npm.io/package/node-mongoose-repository

## Dependencies (4)

- [pino](https://npm.io/package/pino.md) 6.11.1
- [config](https://npm.io/package/config.md) 3.3.0
- [mongoose](https://npm.io/package/mongoose.md) 5.13.9
- [pino-pretty](https://npm.io/package/pino-pretty.md) 4.7.1

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 0.0.20 (latest) — 2021-09-26
- 0.0.19 — 2021-07-14
- 0.0.18 — 2021-07-06
- 0.0.17 — 2021-06-15
- 0.0.16 — 2021-03-26
- 0.0.15 — 2021-03-26
- 0.0.13 — 2021-03-26
- 0.0.12 — 2021-03-26
- 0.0.11 — 2021-03-11
- 0.0.10 — 2021-03-11
- 0.0.9 — 2021-03-11
- 0.0.7 — 2020-08-24
- 0.0.6 — 2020-05-13
- 0.0.5 — 2020-04-18
- 0.0.4 — 2020-03-22
- … 3 more at https://npm.io/package/node-mongoose-repository/versions

## README

# node-mongoose-repository

Based in  [node-dynamoose-repository](https://github.com/salespaulo/node-dynamoose-repository) from [Paulo Sales](https://github.com/salespaulo)

## Examples

### Mapping
#### repository.js
```javascript

const repository = require('node-mongoose-repository')

...

const opt = { timestamps: true }

const UserIndex = [
    { email: 1 },
    { 'name': 'text'}
]

...

module.exports = () => {
    repository.map('User', getTableName('User'), userSchema, opt, UserIndex)
}
```

### Using the model

```javascript

const repository = require('node-mongoose-repository')

...

const model = repository.get('User')

const user = await model.findById(id)
    
```

### Debug mode

Set NOVE_ENV=development

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