Skip to content

MongoDB 오답노트 오답 또는 정답을 다시 풀었을 때 기존의 테이터 존재 #9

@KMGeon

Description

@KMGeon

image

  • 기존의 MongoDB에서 오답 또는 정답을 다시 풀었을 때 기존의 데이터는 지워지고 다시 데이터를 저장을 해야된다.

고려사항

  1. Review User의 중복되는 데이터의 무결성을 검증
  2. ReviewNote 의 중복되는 데이터 무결성 검증

이슈

  • MongoDB Respository를 이용해서 deleteById를 하면 삭제가 되지 않음

문제점

  • MongoDB는 BSON으로 데이터를 저장한다.

해결법

import org.bson.types.ObjectId;
 ObjectId objectId = new ObjectId(match.getId());
  • ObjectId로 Bson으로 변환해서 deleteById를 삭제

Metadata

Metadata

Assignees

Labels

버그Something isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions