Updating a document with elasticsearchjs using typescript throws error

I tried updating a document using elasticsearchjs, using:

export async function esUpdate (index, id, body) {
 
  return es.update({
    body:  JSON.stringify(body),
    id,
    index,
    refresh: true,
    type: DocType
  }).catch(logAndRethrow)
}

It throws error : `Elasticsearch error: {\"msg\":\"[action_request_validation_exception] Validation Failed: 1: script or doc is missing;`

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