# Creating nested object

**URL:** <https://community.neo4j.com/t/creating-nested-object/46776>\
**Category:** Cypher\
**Tags:** cypher\
**Created:** [November 1, 2021, 9:40am UTC](https://community.neo4j.com/t/creating-nested-object/46776 "2021-11-01T09:40:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshay1](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/akshay1/32/20430_2.png) [@akshay1](https://community.neo4j.com/u/akshay1)\
**Post date:** [November 1, 2021, 9:40am UTC](https://community.neo4j.com/t/creating-nested-object/46776/1 "2021-11-01T09:40:43Z")

</div>

I am trying to add data to the database using the following cypher code:

```auto
UNWIND [
    {location: 'Westmere', resource: {medicine: [{unit: 1}], sustenance: [{unit: 1}], equipment: [{unit: 1}]}},
    {location: 'Ponsonby', resource: {medicine: [{unit: 1}], sustenance: [{unit: 1}], equipment: [{unit: 1}]}},
    {location: 'Greylynn', resource: {medicine: [{unit: 1}], sustenance: [{unit: 1}], equipment: [{unit: 1}]}},
    {location: 'Eden Terrace', resource: {medicine: [{unit: 1}], sustenance: [{unit: 1}], equipment: [{unit: 1}]}},
    {location: 'Auckland Central', resource: {medicine: [{unit: 1}], sustenance: [{unit: 1}], equipment: [{unit: 1}]}},
    {location: 'Parnell', resource: {medicine: [{unit: 1}], sustenance: [{unit: 1}], equipment: [{unit: 1}]}},
    {location: 'New Market', resource: {medicine: [{unit: 1}], sustenance: [{unit: 1}], equipment: [{unit: 1}]}}
] AS row CREATE (:Location {location: row.location, resource: row.resource});

```

But I get an error as:

```auto
Neo.ClientError.Statement.TypeError: Property values can only be of primitive types or arrays thereof. Encountered: Map{equipment -> List{Map{unit -> Long(1)}}, medicine -> List{Map{unit -> Long(1)}}, sustenance -> List{Map{unit -> Long(1)}}}.

```

How should I create the `resource` object? Any help would be appreciated
