whats the difference between Type
Vs. type
?!
available : {type: [ {Type:ProductAvailable} ]}
when i use type, like below:-
available : {type: [ {type:ProductAvailable} ]}
it fires errors:-
\\mongoose\\lib\\schema.js:616 throw new TypeError('Undefined type
' + name + '
at array `' + path +TypeError: Undefined type
undefined
at arrayavailable
Thanks :)
type is schemaType (String,Number,Date,Buffer,Boolean,Mixed,ObjectId,Array,Decimal128,Map)
Type : is used with mongoose schema
you can also directly use below :
available : {type: [ProductAvailable]}
meaning : available is Array of ProductAvailable
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.