zkt25/Backend/node_modules/mongoose/lib/helpers/schema/addAutoId.js
Andrii Pervashov d1b27aff06 initial commit
2025-03-16 16:17:44 +01:00

8 lines
173 B
JavaScript

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