Files
lsp/node_modules/mongoose/lib/helpers/schema/addAutoId.js
Arnaud Nelissen 3af7ddab06 Initial commit
2021-11-17 11:25:08 +01:00

7 lines
172 B
JavaScript

'use strict';
module.exports = function addAutoId(schema) {
const _obj = { _id: { auto: true } };
_obj._id[schema.options.typeKey] = 'ObjectId';
schema.add(_obj);
};