UNPKG

172 BJavaScriptView Raw
1'use strict';
2
3module.exports = function addAutoId(schema) {
4 const _obj = { _id: { auto: true } };
5 _obj._id[schema.options.typeKey] = 'ObjectId';
6 schema.add(_obj);
7};
\No newline at end of file