diff --git a/lib/dao.js b/lib/dao.js index 27688a57..9828cb3b 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -231,7 +231,8 @@ DataAccessObject.create = function (data, callback) { obj.trigger('save', function (saveDone) { var _idName = idName(Model); var modelName = Model.modelName; - this._adapter().create(modelName, this.constructor._forDB(obj.toObject(true)), function (err, id, rev) { + var val = removeUndefined(obj.toObject(true)); + this._adapter().create(modelName, this.constructor._forDB(val), function (err, id, rev) { if (id) { obj.__data[_idName] = id; defineReadonlyProp(obj, _idName, id);