node.js - How to sanitize array values in mongoose schema? -
i have following schema:
var schema = new mongoose.schema({ }, {strict: "throw"}); adschema.add({ files: { type: [string] // ^\d{1,2}:[\w-]{7,14}$/ } }); when new model saved mongodb database need sanitize files field values correspond ^\d{1,2}:[\w-]{7,14}$/ , drop other don't.
what base place sanitize?
Comments
Post a Comment