'How to read complete document from cosmos db without mapping to a model class

I am trying to read documents from cosmos DB collection which have no pre-defined schema so reading them as dynamic object or JObject(tried both of them), ReadItemAsync function working correctly and returning object as expected but when this object returned to the client as the response of HTTP request all the properties of the document somehow get assigned with an empty array i.e.([]). Why is this happening?

     public async Task<JObject> GetItemAsync(string id, string partitionKey)
        {
                var result = await _container.ReadItemAsync<JObject>(id, new PartitionKey(partitionKey));
                return result.Resource;            
        }

enter image description here

Expected response

{
    "id": "z_km_pm_clinic_WA1200-6-60076_1610430115000",
    "yearmonth": "202101",
    "asset_id": "WA1200-6-60076",
    "bucket_starttime": "1610430115000",
    "bucket_endtime": "0",
    "buckettype_visibility": "1",
    "wl_engn1_spd_rpm_high_idle_p_mode": "1807.0",
    "wl_engn1_spd_rpm_low_idle_p_mode": "NULL",
    "wl_engn1_spd_rpm_test_2": "NULL",
    "wl_engn1_spd_rpm_test_3": "NULL",
    "wl_engn1_spd_rpm_new_metric_test": "NULL",
    "release_version": "NULL",
    "test_version": "NULL",
    "version": "NULL",
    "_rid": "1G*************AAAAA==",
    "_self": "dbs******************AAA==/",
    "_etag": "\"0000990b-0000-1b00-0000-********000\"",
    "_attachments": "attachments/",
    "_ts": 1622013082
}

Actual response

{"id":[],"yearmonth":[],"asset_id":[],"bucket_starttime":[],"bucket_endtime":[],"buckettype_visibility":[],"wl_engn1_spd_rpm_high_idle_p_mode":[],"wl_engn1_spd_rpm_low_idle_p_mode":[],"wl_engn1_spd_rpm_test_2":[],"wl_engn1_spd_rpm_test_3":[],"wl_engn1_spd_rpm_new_metric_test":[],"release_version":[],"test_version":[],"version":[],"_rid":[],"_self":[],"_etag":[],"_attachments":[],"_ts":[]}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source