Last active
April 17, 2018 17:59
-
-
Save p3x-robot/abcb48d85068629fe9ea857679f25fae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoose.Schema.prototype._originalDefaultOptions = mongoose.Schema.prototype.defaultOptions; | |
mongoose.Schema.prototype.defaultOptions = function(options) { | |
if (options === undefined) { | |
options = {}; | |
} | |
options.timestamps = true; | |
return this._originalDefaultOptions.apply(this._originalDefaultOptions, arguments); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment