-
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
DUY PHAM
committed
Jul 7, 2021
1 parent
4774b83
commit bbd29b1
Showing
4 changed files
with
71 additions
and
10 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
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
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,22 @@ | ||
const mongoose = require("mongoose"); | ||
const { userSchema } = require("./user"); | ||
const Schema = mongoose.Schema; | ||
|
||
const commentSchema = new Schema( | ||
{ | ||
productId: { | ||
type: String, | ||
required: true, | ||
}, | ||
user: userSchema, | ||
content: String, | ||
media: [], | ||
}, | ||
{ timestamps: true } | ||
); | ||
let Comment = mongoose.model("Comments", commentSchema); | ||
|
||
module.exports = { | ||
commentSchema, | ||
Comment, | ||
}; |
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