ccashfrontend/views/node_modules/mongoose/lib/helpers/schema/addAutoId.js
2021-06-18 09:20:09 +10:00

7 lines
No EOL
172 B
JavaScript

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