SchemaObjectIdOptions.js 782 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. const SchemaTypeOptions = require('./SchemaTypeOptions');
  3. /**
  4. * The options defined on an ObjectId schematype.
  5. *
  6. * ####Example:
  7. *
  8. * const schema = new Schema({ testId: mongoose.ObjectId });
  9. * schema.path('testId').options; // SchemaObjectIdOptions instance
  10. *
  11. * @api public
  12. * @inherits SchemaTypeOptions
  13. * @constructor SchemaObjectIdOptions
  14. */
  15. class SchemaObjectIdOptions extends SchemaTypeOptions {}
  16. const opts = require('./propertyOptions');
  17. /**
  18. * If truthy, uses Mongoose's default built-in ObjectId path.
  19. *
  20. * @api public
  21. * @property auto
  22. * @memberOf SchemaObjectIdOptions
  23. * @type Boolean
  24. * @instance
  25. */
  26. Object.defineProperty(SchemaObjectIdOptions.prototype, 'auto', opts);
  27. /*!
  28. * ignore
  29. */
  30. module.exports = SchemaObjectIdOptions;