I want to update the array element based on the lstSmtDt stored in MM-dd-yy format:
N1QL query i am using
UPDATE B234AMS
set opldCns= ARRAY a for a in opldCns when a.lstSmtDt < ‘05-21-17 07:56:34’ END where docType=‘svcPntStoAd’
this query shoud update array and delete array element having lstSmtDt >‘05-21-17 07:56:34’
but this is not working as in N1QL supported format is yy-mm-dd so how can i rewrite my query so that it works without changing date format in database. Is there any way to convert this date using N1QL and use that in update query.
Array:
“opldCns”: [
{
“bpyAtnNa”: “”,
“bpyCoNa”: “JOHN MAPLES”,
“lstSmtDt”: “08-21-17 07:56:34”,
“pkgQy”: 1
},
{
“bpyAtnNa”: “”,
“bpyCoNa”: “JOHN MAPLES”,
“lstSmtDt”: “07-20-20 07:56:34”,
“pkgQy”: 1
},
{
“bpyAtnNa”: “”,
“bpyCoNa”: “JOHN MAPLES”,
“lstSmtDt”: “06-19-18 07:56:34”,
“pkgQy”: 1
}
]