1 | 'use strict';
|
2 |
|
3 | const Document = require('../index').Document;
|
4 |
|
5 | class Data extends Document {
|
6 | constructor() {
|
7 | super();
|
8 |
|
9 | this.schema({
|
10 | number: {
|
11 | type: Number
|
12 | },
|
13 | source: {
|
14 | type: String,
|
15 | choices: ['reddit', 'hacker-news', 'wired', 'arstechnica'],
|
16 | default: 'reddit'
|
17 | },
|
18 | item: {
|
19 | type: Number,
|
20 | min: 0,
|
21 | max: 100
|
22 | },
|
23 | values: {
|
24 | type: [Number]
|
25 | },
|
26 | date: {
|
27 | type: Date,
|
28 | default: Date.now
|
29 | }
|
30 | });
|
31 | }
|
32 | }
|
33 |
|
34 | module.exports = Data; |
\ | No newline at end of file |