How to update existing date:"20/12/2020" to milliseconds in couchbase document

How to update date:“20/12/2020” to milliseconds in couchbase existing document

Assume your day, month always 2 digit and year 4 digit. If not you must use some other way covert those first.

UPDATE  default AS d
SET d.date =  MILLIS(SUBSTR(date,6,4)||"-"||SUBSTR(date,3,2)||"-"||SUBSTR(date,0,2))