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

21 lines
709 B
JavaScript

var mongoose = require('mongoose');
var Schema = mongoose.Schema;
module.exports.schema = new Schema({
name: {type: String, required: true},
urlslug: {type: String, required: true, lowercase: true, unique: true},
productImage: {type: String, required: true},
description: {type: String, required: true},
numberInStock: {type: Number},
price: {type: Number},
images: [String], //Does not include productImage
tags: [String],
publishTime:{type: Number, required: true},
expireTime:{type: Number, required: true},
preorderDate: {type: Number, default: null}
});
module.exports.schema.index({name: 'text', description: 'text'});
module.exports.model = mongoose.model('Sock', module.exports.schema);