Queries return new documents
This commit is contained in:
parent
d71fb9f1d7
commit
08a7e294fd
2 changed files with 2 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ async function getAnswer(question_id, answer_id) {
|
|||
if (!success) return;
|
||||
return Answer.findByIdAndUpdate(answer.answer_id, answer, {
|
||||
upsert: true,
|
||||
new: true,
|
||||
});
|
||||
} else return cachedAnswer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ async function getQuestion(question_id) {
|
|||
if (!success) return;
|
||||
return Question.findByIdAndUpdate(question.question_id, question, {
|
||||
upsert: true,
|
||||
new: true,
|
||||
});
|
||||
} else return cachedQuestion;
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue