A schema is used to describe the structure of data. It can be one of:
{
type :: 'string'
choices: Array String | Null,
match: RegExp | Null,
minLength: Number,
maxLength: Number
}
{
type: 'number'
min: Number,
max: Number
}
{
type: 'boolean'
}
{
type: 'buffer'
}
{
type: 'date',
min: Date || Null,
max: Date || Null
}
{
type: 'array',
minLength: Number,
maxLength: Number,
schema: Schema
}
{
type: 'object',
fields: StrMap Schema
}
{
type: 'unique',
schema: Schema
}
Represents a mongoose model.
One of 'one-one'
'one-many'
'many-many'
.
{
type: RelationType,
source: {
name: String,
field: String || Null,
},
target: {
name: String,
field: String || Null,
}
}