model.js 656 B

123456789101112131415161718192021222324252627
  1. 'use strict';
  2. var mongoose = require('mongoose');
  3. var Schema = mongoose.Schema;
  4. var informationSchema = {
  5. text: {
  6. shortDesc: { type: String },
  7. fullDesc: { type: String },
  8. application: { type: String },
  9. actives: [ String ],
  10. ph: { type: String },
  11. },
  12. category: {
  13. _id: Schema.ObjectId,
  14. name: { type: String }
  15. }
  16. };
  17. module.exports = mongoose.model('Product', mongoose.Schema({
  18. name: { type: String, required: true },
  19. imgUrl: { type: String },
  20. thumbUrl: { type: String },
  21. size: [ String ],
  22. ES: informationSchema,
  23. EN: informationSchema
  24. }))