Painless compare string dates


I need compare two dates in painless script inline to update documents. I try in Kibana Console:

GET indexName/Type/1111/_update
    "lang": "painless",
    "inline": "ctx._source.accounts.removeIf(i -> i.accountId == params.newobject.accountId && i.expirationDate < params.newobject.expirationDate);
    "params": {
        "accountId": 3,
        "expirationDate": "2017-09-18T18:42:39.965Z"

But i get error

class_cast_exception: Cannot apply [<] operation to types [java.lang.String] and [java.lang.String]

How I convert the string to date for compare in script?


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.