Update: add default values
This commit is contained in:
parent
91915dc1a9
commit
ee253ba76b
1 changed files with 28 additions and 7 deletions
|
|
@ -2,13 +2,34 @@ module.exports = mongoose => {
|
||||||
let schema = mongoose.Schema({
|
let schema = mongoose.Schema({
|
||||||
userId: String,
|
userId: String,
|
||||||
title: String,
|
title: String,
|
||||||
images: Array,
|
images: {
|
||||||
url: String,
|
type: Array,
|
||||||
interests: Array,
|
default: []
|
||||||
comment: String,
|
},
|
||||||
views: Array,
|
url: {
|
||||||
isVisible: Boolean,
|
type: String,
|
||||||
isActive: Boolean
|
default: null
|
||||||
|
},
|
||||||
|
interests: {
|
||||||
|
type: Array,
|
||||||
|
default: []
|
||||||
|
},
|
||||||
|
comment: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
views: {
|
||||||
|
type: Array,
|
||||||
|
default: []
|
||||||
|
},
|
||||||
|
isVisible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
isActive: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ timestamps: true }
|
{ timestamps: true }
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Reference in a new issue