Last active
August 14, 2017 03:02
-
-
Save thebopshoobop/e953cd955e91d8834f454348a1237b63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
const ProductSchema = new mongoose.Schema({ | |
name: String, | |
price: Number, | |
category: { | |
type: Schema.Types.ObjectId, | |
ref: "Category" | |
} | |
}); | |
//... | |
const CategorySchema = new mongoose.Schema({ name: String }); | |
//... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment