Commit With Frontend and Backend in MERN
This commit is contained in:
7
backend/node_modules/mongoose/lib/helpers/schema/addAutoId.js
generated
vendored
Normal file
7
backend/node_modules/mongoose/lib/helpers/schema/addAutoId.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function addAutoId(schema) {
|
||||
const _obj = { _id: { auto: true } };
|
||||
_obj._id[schema.options.typeKey] = 'ObjectId';
|
||||
schema.add(_obj);
|
||||
};
|
||||
Reference in New Issue
Block a user