Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/weisjohn/mongoose-address-easy

add address fields to a schema
https://github.com/weisjohn/mongoose-address-easy

Last synced: about 1 month ago
JSON representation

add address fields to a schema

Awesome Lists containing this project

README

        

# mongoose-address-easy

add address fields to a schema

### usage

```javascript
var mongoose = require('mongoose');
var mae = require('mongoose-address-easy');

var schema = new mongoose.Schema({ name: String });

mae(schema);
```

plugin style:

```javascript
schema.plugin(mae);
```

### options

To mark all fields as required (except `address_line2`), use:

```javascript
schema.plugin(mae, { required: true });
```