-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mennatallah Ramadan
authored and
Mennatallah Ramadan
committed
Mar 3, 2019
1 parent
d42966c
commit b513fe6
Showing
6 changed files
with
686 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var mongoose = require('mongoose'); | ||
|
||
var product = new mongoose.Schema({ | ||
title: String, | ||
price: Number, | ||
likes: {type: Number, default: 0} | ||
}) | ||
|
||
//product is what will stored in JS | ||
module.exports = mongoose.model('Product', product); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var mongoose = require('mongoose'); | ||
var ObjectId = mongoose.Schema.Types.ObjectId; | ||
|
||
var wishList = new mongoose.Schema({ | ||
title: {type: String, default: "Cool Wish List", require: true}, | ||
products: [{type: ObjectId, ref:'product'}] //this is the relationships | ||
}); | ||
|
||
//product is what will stored in JS | ||
module.exports = mongoose.model('WishList', wishList); |
Oops, something went wrong.