mirror of
				https://github.com/KevinMidboe/planetposen.git
				synced 2025-10-29 17:50:32 +00:00 
			
		
		
		
	Server handles creating and fetching products and their variations. Models are saved to mongo using mongoose. STILL PRETTY BARE BONES!
		
			
				
	
	
		
			13 lines
		
	
	
		
			256 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			256 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
const mongoose = require('mongoose');
 | 
						|
const Schema = mongoose.Schema;
 | 
						|
 | 
						|
const Variation = new Schema({
 | 
						|
  size: String,
 | 
						|
  description: String,
 | 
						|
  stock: Number,
 | 
						|
  price: Number,
 | 
						|
  discount: Number
 | 
						|
});
 | 
						|
 | 
						|
module.exports = mongoose.model("Variation", Variation);
 |