# Issue with \_update command

**URL:** <https://discuss.elastic.co/t/issue-with-update-command/236841>\
**Category:** Elasticsearch\
**Created:** [June 12, 2020, 7:27am UTC](https://discuss.elastic.co/t/issue-with-update-command/236841 "2020-06-12T07:27:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayyappa\_P](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayyappa_p/32/59015_2.png) [@Ayyappa\_P](https://discuss.elastic.co/u/Ayyappa_P)\
**Post date:** [June 12, 2020, 7:27am UTC](https://discuss.elastic.co/t/issue-with-update-command/236841/1 "2020-06-12T07:27:39Z")

</div>

Hi,

I've a data in the following format.

```auto
    {
        "uTestTokenId": "8488DA03-447F-46DF-B431-03C027674A16",
        "vTestTokenNumber": "",
        "uCycleId": "0FDDDE67-6793-4093-9790-9E3611356C8B",
        "uPupilId": "2903F23B-1AB4-4130-852A-40A3ABD68C99",
        "uTestId": "C9C87DEB-E6B9-4D86-9774-73FF0222E6B3",
        "dtCreatedOn": "2020-06-11T00:00:00",
        "uClassId": "E420AACD-76C5-4E89-8DC6-1C60045C5D50",
        "uParentTestId": null,
        "iSubjectId": null,
        "iCycleRepetition": 3,
        "uSchoolId": "18FA5392-2AD9-484A-A03D-A8A2EFF76859",
        "iStateId": 454,
        "iClassTypeId": null,
        "TestExecution": [
          {
            "uExecutionId": "68B37632-CF15-43D1-A07E-789ECB9D7F71",
            "dtLastTaskAnsweredOn": "2020-06-11T08:41:50",
            "iTotalEffectiveTimeTaken": 385,
            "iTaskCountDisplayed": 11,
            "iNoOfLoginAttempts": 1,
            "dtTestEnd": null,
            "iTestStatusId": 3,
            "uTestTokenId": "8488DA03-447F-46DF-B431-03C027674A16",
            "dtTestStart": "2020-06-11T08:39:56"
          }
        ],
        "TestResultSummary": [],
        "TestResultSummarySubSubject": []
     }

```

I'm running below update script on the above data from C# Through API's

```auto
POST <INDEXNAME>/<TypeName>/<PrimaryKeyValue>/_update
    {
      "doc": {
        "uTestTokenId": "8488DA03-447F-46DF-B431-03C027674A16",
        "vTestTokenNumber": "",
        "uCycleId": "0FDDDE67-6793-4093-9790-9E3611356C8B",
        "uPupilId": "2903F23B-1AB4-4130-852A-40A3ABD68C99",
        "uTestId": "C9C87DEB-E6B9-4D86-9774-73FF0222E6B3",
        "dtCreatedOn": "2020-06-11T00:00:00",
        "uClassId": "E420AACD-76C5-4E89-8DC6-1C60045C5D50",
        "uParentTestId": null,
        "iSubjectId": null,
        "iCycleRepetition": 3,
        "uSchoolId": "18FA5392-2AD9-484A-A03D-A8A2EFF76859",
        "iStateId": 454,
        "iClassTypeId": null,
        "TestExecution": [
          {
            "uExecutionId": "68B37632-CF15-43D1-A07E-789ECB9D7F71",
            "iTestStatusId": 5,
            "uTestTokenId": "8488DA03-447F-46DF-B431-03C027674A16",
            "dtTestStart": "2020-06-11T08:39:56.78",
            "dtTestEnd": "2020-06-11T08:41:48.49",
            "iTaskCountDisplayed": 11,
            "iTotalEffectiveTimeTaken": 385,
            "dtLastTaskAnsweredOn": "2020-06-11T08:41:50.613",
            "iNoOfLoginAttempts": 1
          }
        ],
        "TestResultSummary": [
          {
            "uResultSummaryId": "5F3BBAB6-D1A4-4044-9727-5A6ACE0336B5",
            "uExecutionId": "68B37632-CF15-43D1-A07E-789ECB9D7F71",
            "iTaskObjectsCorrect": 12,
            "iTaskObjectsWrong": 5,
            "iTaskObjectsNotAnswered": 0,
            "vResultAttribute": "{\"PartiallyCorrectTasks\":1,\"TestObjectsWrong\":5,\"TestObjectsNotAnswered\":0,\"TestPercentage\":-10000,\"TestLanguageId\":3,\"EffectiveTestTimeinSeconds\":385,\"TestEnd\":\"11.06.2020 08:41:48\",\"Result_Unit\":\"\",\"EffectiveTestTimeinMinutes\":7,\"Grade\":-10000,\"Result_Key\":\"TestPoint\",\"FullyWrongTasks\":4,\"NotAttemptedTasks\":0,\"FullyCorrectTasks\":6,\"DateWhenTestExecuted\":\"11.06.2020 08:39:56\",\"TestPoint\":0,\"TestName\":\"Deutsch-Hören-1-R3\",\"TotalTasksCount\":11,\"TestExecutionDate\":\"2020.06.11\",\"Result\":0,\"TestObjectsCorrect\":12,\"TestMaxPoint\":0}"
          }
        ],
        "TestResultSummarySubSubject": []
      },
      "doc_as_upsert": true
    }

```

I'm getting Proper response from

```auto
 {
    "_index":"IndexName",
    "_type":"TypeName",
    "_id":"ID",
    "_version":11,
    "result":"updated",
    "_shards":{"total":2,"successful":2,"failed":0},"
    _seq_no":646878,
    "_primary_term":4
 }

```

But the data is not getting updated.  
When I'm running the same command in Kibana directly, then it is working fine. Is there any issue because of date formats? But Response looks fine.

> result: 'updated'

Which means it has update the records properly.

Please let me know what is the issue?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 10, 2020, 7:27am UTC](https://discuss.elastic.co/t/issue-with-update-command/236841/2 "2020-07-10T07:27:44Z")

</div>

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