본문 바로가기
2021-1/Expert

MongoDB | dateFromString

by 이망고_ 2021. 10. 28.

arrgregate 기본형태
원하던 코드 같기는 한데..

현재 데이터가 date 가 아니라 string으로 되어 있어서 먼저 변환을 해줘야 하나

킬링은 dateString 값 계속 오류나서 ' ' -> " " 로 바꿨더니 DateTime 으로 바뀌었다!!
아무 컬럼이랑 비교해봐서 prdStart 가 잘 매치되었는지 비교해보자
3번 컬럼 잘 매치됨! 2020-10-26

https://docs.mongodb.com/v4.2/reference/operator/aggregation/dateFromString/ 

 

$dateFromString (aggregation) — MongoDB Manual

timezone Optional. The time zone to use to format the date. Note If the dateString argument is formatted like ‘2017-02-08T12:10:40.787Z’, in which the ‘Z’ at the end indicates Zulu time (UTC time zone), you cannot specify the timezone argument. all

docs.mongodb.com

전체적인 MongoDB 함수 다 있으니 참고하세요