Added documentation on usage of Enum.

This commit is contained in:
dgsan 2013-06-18 12:32:42 -06:00
parent f2412bc170
commit 2ec1995350
1 changed files with 14 additions and 0 deletions

View File

@ -93,6 +93,20 @@ The following type-dataType combinations are supported:
Example: Example:
`{ startTime : { type: Date, dataType: 'timestamp' }}` `{ startTime : { type: Date, dataType: 'timestamp' }}`
* <h4> Enum </h4>
Create an Enum using Enum factory:
```javascript
var MOOD = schema.EnumFactory('glad', 'sad', 'mad');
MOOD.SAD; // 'sad'
MOOD(2); // 'sad'
MOOD('SAD'); // 'sad'
MOOD('sad'); // 'sad'
```
* `{ mood: { type: MOOD } }`
* `{ choice: { type: schema.EnumFactory('yes', 'no', 'maybe'), null: false }`
## MIT License ## MIT License
```text ```text