티스토리 뷰

반응형

주문일자가 'YYYYMMDD' 형식일 경우....

--------------------------------------------------------------

<SQL>

SELECT *

FROM ORDERS

WHERE ORDER_DT = TO_CHAR(SYSDATE, 'YYYYMMDD')

;

<MQL>

db.ORDERS.aggregate(

[

{$match:{ ORDER_DT:{$eq: ISODate().toISOString().substring(0,10).replace(/-/gi,'')} } }

]

);

--------------------------------------------------------------------------------------------------------

new Date().toISOString().substring(0,10).replace(/-/gi,'')

or

ISODate().toISOString().substring(0,10).replace(/-/gi,'')

--------------------------------------------------------------------------------------------------------

replace(/-/gi,'') 는 replaceAll('-','')과 같은 동작

--------------------------------------------------------------------------------------------------------

반응형