Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

objectid.js 544B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * ObjectId type constructor
  3. *
  4. * ####Example
  5. *
  6. * var id = new mongoose.Types.ObjectId;
  7. *
  8. * @constructor ObjectId
  9. */
  10. 'use strict';
  11. const ObjectId = require('../driver').get().ObjectId;
  12. const objectIdSymbol = require('../helpers/symbols').objectIdSymbol;
  13. /*!
  14. * Getter for convenience with populate, see gh-6115
  15. */
  16. Object.defineProperty(ObjectId.prototype, '_id', {
  17. enumerable: false,
  18. configurable: true,
  19. get: function() {
  20. return this;
  21. }
  22. });
  23. ObjectId.prototype[objectIdSymbol] = true;
  24. module.exports = ObjectId;