Arrays of schema types on Mongoose
问题 I have a schema: var s = new Schema({ links: { type: [Url] } }); In this case I am using the url schema type from https://github.com/bnoguchi/mongoose-types - but I have tried this with other types. Mongoose doesn't seem to validate/use the schema type when in an array - works fine without the array. How can I define an array of schema types that will validate? 回答1: Answer from Mongoose creator: "Unless the Url is a subdocument, validation will not get triggered currently (there is a ticket