-
Notifications
You must be signed in to change notification settings - Fork 6
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
tuwq
committed
Apr 29, 2018
1 parent
524bc55
commit 2fe5eef
Showing
5 changed files
with
52 additions
and
7 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,5 @@ | ||
const mongoose = require('mongoose'); | ||
const answerUser = require('../schema/answer_user.js') | ||
var AnswerUser = mongoose.model('AnswerUser', answerUser,'answerUser') | ||
|
||
module.exports = AnswerUser |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const mongoose = require('mongoose'); | ||
const question_user = require('../schema/question_user.js') | ||
var Question_user = mongoose.model('Question_user', question_user,'question_user') | ||
const questionUser = require('../schema/question_user.js') | ||
var QuestionUser = mongoose.model('QuestionUser', questionUser,'questionUser') | ||
|
||
module.exports = Question_user | ||
module.exports = QuestionUser |
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,28 @@ | ||
const mongoose = require('mongoose') | ||
const Schema = mongoose.Schema; | ||
const { ObjectId, Mixed } = Schema.Types | ||
|
||
var AnswerUserSchema = new Schema({ | ||
answer_id: { | ||
type: ObjectId, | ||
ref: 'Answer' | ||
}, | ||
user_id: { | ||
type: ObjectId, | ||
ref: 'User' | ||
}, | ||
vote: { | ||
unique: false, | ||
required: true, | ||
type: Number, | ||
default: 0 | ||
}, | ||
bad: { | ||
unique: false, | ||
required: true, | ||
type: Number, | ||
default: 0 | ||
} | ||
}) | ||
|
||
module.exports = AnswerUserSchema |
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