# Nested object in Vega lite

**URL:** https://discuss.elastic.co/t/nested-object-in-vega-lite/201782
**Category:** Kibana
**Tags:** vega
**Created:** [October 1, 2019, 11:12am UTC](https://discuss.elastic.co/t/nested-object-in-vega-lite/201782 "2019-10-01T11:12:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kilianten](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@kilianten](https://discuss.elastic.co/u/kilianten)
#### Post date: [October 1, 2019, 11:12am UTC](https://discuss.elastic.co/t/nested-object-in-vega-lite/201782/1 "2019-10-01T11:12:59Z")

</div>

```auto
        {
          "key_as_string" : "2019-02-14T00:00:00.000Z",
          "key" : 1550303400050,
          "doc_count" : 5,
          "daily" : {
            "hits" : {
              "total" : {
                "value" : 5,
                "relation" : "eq"
              },
              "max_score" : null,
              "hits" : [
                {
                  "_index" : "recordedSpeed",
                  "_type" : "_doc",
                  "_id" : "12341::1231541412413::1231241579508",
                  "_score" : null,
                  "_source" : {
                    "Car" : "Volvo",
                    "speed" : 10.0
                  },
                  "sort" : [
                    10.0
                  ]
                }
              ]
            }
          }
        }

```

Hey!  
Im creating a chart in vega-lite and my buckets return this.  
I want to have speed on the y-axis and car on the x-axis.  
I was hoping

daily.hits.hits.\_source.Car  
daily.hits.hits.\_source.Speed

would give me what I wanted but it doesnt seem to work. Ive tried flattening the data but it doesn't appear to work either.

I also tried

{  
"calculate": "datum["daily"]["hits"]["hits"]["source"]",  
"as": "car"  
}

Help would be appreciated!

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [October 1, 2019, 4:20pm UTC](https://discuss.elastic.co/t/nested-object-in-vega-lite/201782/2 "2019-10-01T16:20:36Z")

</div>

@nyuriks - can you please help

Thanks  
Rashmi

---

<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: [October 29, 2019, 4:20pm UTC](https://discuss.elastic.co/t/nested-object-in-vega-lite/201782/3 "2019-10-29T16:20:37Z")

</div>

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