[스파르타7기] 개발일지6 - 2020.04.23

Tia Hwang·2020년 4월 23일
0

스파르타7기

목록 보기
7/12

오늘한일

1. selectbox로 통계내고싶은 month를 선택한후, "보기" 버튼을 누르면 chart 출력

2. mongoDB에서 데이터를 가져올때 새로운 array들 형성 🥺

1) 현재 접속된 이메일의 습관 array 형성
2) 월별로 새로운 array 형성
3) 선택한 month의 습관정보만 가져오는 array 형성
➡️ selectbox value값을 이용
4) 3번째로 만든 array를 다시 습관이름별로 array 형성

3. chart와 data 정보 연결

  • chart type: 도넛으로 변경
  • 그래프가 구현된 화면

4. habit 이름 수정 기능

  • My habits 박스안의 습관을 클릭하면 prompt 창으로 새로운 이름 작성할 수 있게함
  • 현재 db collection이 2개(habits, calendars)라서 각각 업데이트 설정
db.habits.update({'habit': name_receive}, {'$set': {'habit': edited_name_receive}})
db.calendars.update({'title': name_receive}, {'$set': {'title': edited_name_receive}}, upsert=True, multi=True)

GitHub Commit

문제발생❗
1. habit 이름이 같다면, 다른 이메일의 habit 이름까지 수정되는 문제 발생
2. 경고문고: "DeprecationWarning: update is deprecated."
➡️ 아래와 같이 코드 수정

db.habits.update_one({'email': email_receive, 'habit': name_receive}, {'$set': {'habit': edited_name_receive}})
db.calendars.update_many({'title': name_receive, 'email': email_receive}, {'$set': {'title': edited_name_receive}})

GitHub Commit

해야할일

1. habit 추가 기능

2. CSS 작업

GitHub commit

profile
프론트엔드 개발자로 취업하기

0개의 댓글