Q:

How do i check creation time of a ES doc in ES 7.3v? 

I want to know the creation time of my document in elasticsearch, is there any meta field which keeps this information or if it's not there then how do i implement it.   
I am making upsert request everytime and so providing time is not possible. 
upsert request is:
POST test/_update/document_id
{
"doc": {
 "field1": "value1",
 "field2": "value2",
 "field3": "value3",
 "relationship": {
  "parent": "child"
 }
},
 "doc_as_upsert": "true"
}

using elasticsearch npm and the following code:
esDoc.doc['relationship'] = { name: "test" };
esDoc['doc_as_upsert'] = true;
bulkQueue.add({ update: { _index: ES_INDEX_PREFIX + testId, _id: _id } }, esDoc)

A:

One way to achieve this is to leverage ingest pipelines and record the value of _ingest.timestamp in the document.  
First create the following ingest pipeline:
PUT _ingest/pipeline/set_timestamp
{
  "description": "adds the timestamp when a document is indexed",
  "processors": [
    {
      "set": {
        "field": "indexed_at",
        "value": "{{_ingest.timestamp}}"
      }
    }
  ]
}

Then when indexing new documents, simply reference that pipeline in your request:
PUT tmp/_doc/1?pipeline=set_timestamp
{
  "test": "foo"
}

And your document will contain a new field called indexed_at containing the exact timestamp at which it was indexed:
GET tmp/_doc/1
{
  "test" : "foo",
  "indexed_at" : "2019-10-03T13:19:03.181Z"
}

UPDATE:
Since you're using the Update API with document upsert, you don't have access to the ingest pipelines.  What I suggest doing is a scripted_upsert instead, like this:
POST test/_update/document_id
{
 "scripted_upsert":true,
 "script": {
   "source": """
     // update all fields
     ctx._source.putAll(params); 

     // add timestamp the first time
     if (ctx._source.indexed_at == null) {
        def now = Instant.ofEpochMilli(new Date().getTime());
        ZonedDateTime zdt = ZonedDateTime.ofInstant(now, ZoneId.of('Z'));
        ctx._source.indexed_at = zdt.format(DateTimeFormatter. ISO_INSTANT);
     }
   """,
   "params": {
     "field1": "value1",
     "field2": "value2",
     "field3": "value3",
     "relationship": {
       "parent": "child"
     }
   }
 },
 "upsert": {}
}

