Merged
Conversation
new-deni
reviewed
Feb 7, 2025
src/scripts/insertQuiz.ts
Outdated
Comment on lines
117
to
123
| for (const quiz of quizzes) { | ||
| const quizId = v4(); | ||
| await Quiz.findOneAndUpdate( | ||
| { id: quiz.id }, | ||
| { $setOnInsert: quiz }, | ||
| { id: quizId }, | ||
| { $setOnInsert: { ...quiz, id: quizId } }, | ||
| { upsert: true, new: true } | ||
| ); |
There was a problem hiding this comment.
왜 스트링 숫자로 만들고 upsert를 하나요? id를 처음부터 uuid로 만들면 되지 않나요?
new-deni
reviewed
Feb 8, 2025
src/scripts/insertQuiz.ts
Outdated
| answer: 'Hello, world!', | ||
| hint: '코드를 작성하고 결과를 확인하세요.', | ||
| description: '목표 지점까지 이동한 후 공격하세요.', | ||
| order: 1, |
There was a problem hiding this comment.
저라면 nextId, previousId를 관리했을 것 같아요.
퀴즈가 1000개라고 할 때 첫 번째 퀴즈를 바꾼다면 기존 퀴즈 1000개의 order를 전부 바꿔야 하는데 링크드리스트 형태로 관리하면 가리키는 아이디만 바꾸면 되니까요.
Squashed commits: [c303daf] refactor: firstQuiz 추가, insertQuiz order필드 추가
…ayground-server into feature/api-read
…, nextId, uuid 삽입), server(currentQuiz만 응답)
|
new-deni
approved these changes
Feb 8, 2025
new-deni
left a comment
There was a problem hiding this comment.
훨씬 자연스러워졌네요.
isFirst 필드를 만드는 것도 유효하지만 도큐먼트 하나 빼곤 모두 false일 테니 첫 번째 퀴즈 아이디를 들고 있는 테이블(컬렉션)을 만드는 방법도 괜찮았을 것 같아요. 참고만 하세요~
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


feature: uuid 형식으로 id 형식변경, 전체퀴즈목록 조회(id, title), 한문제씩 퀴즈문제 조회.