@ydv/mongo
Advanced tools
Comparing version 1.1.7 to 1.2.0
25
index.js
@@ -33,18 +33,17 @@ const omit = require('lodash/omit') | ||
exports.Schema = (attributes, options) => { | ||
options = Object.assign( | ||
{ | ||
toJSON: { | ||
getters: true, | ||
virtuals: true, | ||
transform: (doc, object) => { | ||
// Omit common private properties from toJSON | ||
return omit(object, ['password', '__v']) | ||
} | ||
}, | ||
id: false //remove copy of _id in the end result | ||
options = { | ||
toJSON: { | ||
getters: true, | ||
virtuals: true, | ||
transform: (doc, object) => { | ||
// Omit common private properties from toJSON | ||
return omit(object, ['password', '__v']) | ||
} | ||
}, | ||
options || {} | ||
) | ||
id: false, //remove copy of _id in the end result | ||
timestamps: true, | ||
...options | ||
} | ||
return new mongoose.Schema(attributes, options) | ||
} |
{ | ||
"name": "@ydv/mongo", | ||
"version": "1.1.7", | ||
"version": "1.2.0", | ||
"repository": "YottaDV/mongo", | ||
@@ -5,0 +5,0 @@ "scripts": { |
2033
40