Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed; Mixed can now default to empty arrays

  • Loading branch information...
commit bacfbcd484a973e92ae431d4d6082a94d328d4dc 1 parent 18d7f13
Aaron Heckmann aheckmann authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/mongoose/schema/mixed.js
8 lib/mongoose/schema/mixed.js
View
@@ -14,6 +14,14 @@ var SchemaType = require('../schematype');
*/
function Mixed (path, options) {
+ // make sure empty array defaults are handled
+ if (options &&
+ options.default &&
+ Array.isArray(options.default) &&
+ 0 === options.default.length) {
+ options.default = Array;
+ }
+
SchemaType.call(this, path, options);
};
Please sign in to comment.
Something went wrong with that request. Please try again.