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.

PopulateOptions.js 619B

123456789101112131415161718192021222324252627282930
  1. 'use strict';
  2. const utils = require('../utils');
  3. class PopulateOptions {
  4. constructor(obj) {
  5. this._docs = {};
  6. if (obj == null) {
  7. return;
  8. }
  9. obj = utils.clone(obj);
  10. Object.assign(this, obj);
  11. if (typeof obj.subPopulate === 'object') {
  12. this.populate = obj.subPopulate;
  13. }
  14. }
  15. }
  16. /**
  17. * The connection used to look up models by name. If not specified, Mongoose
  18. * will default to using the connection associated with the model in
  19. * `PopulateOptions#model`.
  20. *
  21. * @memberOf PopulateOptions
  22. * @property {Connection} connection
  23. * @api public
  24. */
  25. module.exports = PopulateOptions;