i've encountered some error with my schema on mongoose.
my schema looks like:
{
accomodations : {
rooms : {
type : [{
rooms : [{
type : {
id : { type : Number },
name : {
ita : { type : String },
eng : { type : String },
},
numberOfRooms : { type : Number },
},
}],
boards : [{
id : { type : String },
type : {
id : { type : Number },
name : {
ita : { type : String },
eng : { type : String },
},
},
amount : {
currency : { type : String },
directPayment : { type : Boolean },
totalPrice : { type : Number },
mandatory : { type : Boolean },
priceAgency : { type : Number },
refundable : { type : Boolean },
markupPrice : { type : Number },
},
}],
amenities : [{ type : mongoose.Schema.Types.Mixed }],
}],
},
}
}
if i use "type" as property name i receive an error:
Invalid schema configuration: [object Object] is not a valid type within the array rooms.See http:// bit.ly /mongoose-schematypes for a list of valid schema types.
it's required for me have a property called type in my schema.