Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/weisjohn/mongoose-address-easy
- Owner: weisjohn
- License: mit
- Created: 2015-07-22T21:26:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-08T22:29:42.000Z (over 9 years ago)
- Last Synced: 2024-11-15T00:16:53.367Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/mongoose-address-easy
- Size: 137 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 });
```