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

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -