Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose schema cast decimals

var intHolderSchema = new mongoose.Schema({
  'integer': { type: Number, set: function (v) { return Math.round(v) ;}}
}) ;
 
PREVIOUS NEXT
Tagged: #mongoose #schema #cast #decimals
ADD COMMENT
Topic
Name
7+8 =