# openifyit-mongoose-types

> More types for mongoose

Latest version **2.0.9** (published 2013-03-17) · 0 weekly downloads

## Install

```sh
npm install openifyit-mongoose-types
pnpm add openifyit-mongoose-types
yarn add openifyit-mongoose-types
bun add openifyit-mongoose-types
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.9 |
| Published | 2013-03-17 |
| First published | 2013-02-25 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| Author | Brian Noguchi |
| Maintainers | jackdbernier |
| Keywords | mongoose, mongo, mongodb, types, url, email, Schema |

## Links

- npm: https://www.npmjs.com/package/openifyit-mongoose-types
- Repository: https://github.com/OpenifyIt/mongoose-types
- npm.io page: https://npm.io/package/openifyit-mongoose-types

## Dependencies (2)

- [mongoose](https://npm.io/package/mongoose.md) 3.5.x
- [coffee-script](https://npm.io/package/coffee-script.md) 1.4.x

## 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
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 2.0.9 (latest) — 2013-03-17
- 2.0.8 — 2013-03-17
- 2.0.7 — 2013-03-09
- 2.0.6 — 2013-03-05
- 2.0.5 — 2013-03-05
- 2.0.4 — 2013-02-28
- 2.0.3 — 2013-02-28
- 2.0.2 — 2013-02-28
- 2.0.1 — 2013-02-26
- 2.0.0 — 2013-02-25

## README

mongoose-types - Useful types for Mongoose
==============

[![Build Status](https://travis-ci.org/OpenifyIt/mongoose-types.png?branch=master)](https://travis-ci.org/OpenifyIt/mongoose-types)

### Types include:

- Email
- Url

### Installation
    npm install mongoose-types

### Setup

To include all of the defined types:

    var mongoose = require("mongoose");
    var db = mongoose.createConnection("mongodb://localhost/sampledb");
    var mongooseTypes = require("mongoose-types");
    mongooseTypes.loadTypes(mongoose);

You can also specify that you only want to load and use a limited subset of the types provided:

    var mongoose = require("mongoose");
    var db = mongoose.createConnection("mongodb://localhost/sampledb");
    var mongooseTypes = require("mongoose-types");
    // Only load the email type
    mongooseTypes.loadTypes(mongoose, "email");

### Using the types

Once you are setup, you can begin to use the new types.

#### Email

    var Email = mongoose.SchemaTypes.Email;
    var UserSchema = new Schema({
      email: {
          work: Email
        , home: Email
      }
    });

#### Url

    var Url = mongoose.SchemaTypes.Url;
    var VisitSchema = new Schema({
        url: Url
      , referer: Url
    });

## Tests

To run tests (you must have a running instance of mongodb):

    make test

### Contributors

- [Brian Noguchi](https://github.com/bnoguchi)
- [Openify.it](https://github.com/Openify.it)

### License

MIT License

---
### Author

Brian Noguchi

### Rewritten by

Openify.it

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