browser.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**
  2. * The [MongooseError](#error_MongooseError) constructor.
  3. *
  4. * @method Error
  5. * @api public
  6. */
  7. exports.Error = require('./error');
  8. /**
  9. * The Mongoose [Schema](#schema_Schema) constructor
  10. *
  11. * ####Example:
  12. *
  13. * var mongoose = require('mongoose');
  14. * var Schema = mongoose.Schema;
  15. * var CatSchema = new Schema(..);
  16. *
  17. * @method Schema
  18. * @api public
  19. */
  20. exports.Schema = require('./schema');
  21. /**
  22. * The various Mongoose Types.
  23. *
  24. * ####Example:
  25. *
  26. * var mongoose = require('mongoose');
  27. * var array = mongoose.Types.Array;
  28. *
  29. * ####Types:
  30. *
  31. * - [ObjectId](#types-objectid-js)
  32. * - [Buffer](#types-buffer-js)
  33. * - [SubDocument](#types-embedded-js)
  34. * - [Array](#types-array-js)
  35. * - [DocumentArray](#types-documentarray-js)
  36. *
  37. * Using this exposed access to the `ObjectId` type, we can construct ids on demand.
  38. *
  39. * var ObjectId = mongoose.Types.ObjectId;
  40. * var id1 = new ObjectId;
  41. *
  42. * @property Types
  43. * @api public
  44. */
  45. exports.Types = require('./types');
  46. /**
  47. * The Mongoose [VirtualType](#virtualtype_VirtualType) constructor
  48. *
  49. * @method VirtualType
  50. * @api public
  51. */
  52. exports.VirtualType = require('./virtualtype');
  53. /**
  54. * The various Mongoose SchemaTypes.
  55. *
  56. * ####Note:
  57. *
  58. * _Alias of mongoose.Schema.Types for backwards compatibility._
  59. *
  60. * @property SchemaTypes
  61. * @see Schema.SchemaTypes #schema_Schema.Types
  62. * @api public
  63. */
  64. exports.SchemaType = require('./schematype.js');
  65. /**
  66. * Internal utils
  67. *
  68. * @property utils
  69. * @api private
  70. */
  71. exports.utils = require('./utils.js');
  72. /**
  73. * The Mongoose browser [Document](#document-js) constructor.
  74. *
  75. * @method Document
  76. * @api public
  77. */
  78. exports.Document = require('./document_provider.js')();
  79. /*!
  80. * Module exports.
  81. */
  82. if (typeof window !== 'undefined') {
  83. window.mongoose = module.exports;
  84. window.Buffer = Buffer;
  85. }