# Problem with transforming JSON in Graph DB

**URL:** <https://community.neo4j.com/t/problem-with-transforming-json-in-graph-db/7134>\
**Category:** Import / Export\
**Tags:** apoc, import\
**Created:** [May 5, 2019, 9:10am UTC](https://community.neo4j.com/t/problem-with-transforming-json-in-graph-db/7134 "2019-05-05T09:10:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![malik.sog](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/malik.sog/32/4671_2.png) [@malik.sog](https://community.neo4j.com/u/malik.sog)\
**Post date:** [May 5, 2019, 9:10am UTC](https://community.neo4j.com/t/problem-with-transforming-json-in-graph-db/7134/1 "2019-05-05T09:10:21Z")

</div>

Hello everyone,

I am currently working on a graph-db project and have a problem. I can't build a graph in neo4j from a "Meetup"-JSON. I try the following command:

```auto
WITH "https://api.meetup.com/UX-Basel-Meetups/events?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&status=past" AS url
CALL apoc.load.json(url) YIELD value
unwind value as event
return event

```

the following error is given by neo4j:

```auto
Neo.ClientError.Statement.SyntaxError: Type mismatch: expected List<T> but was Map (line 3, column 8 (offset: 162))
"unwind value as event"

```

It expects a list instead of a map. But in other examples I found in the forum, a JSON is treated that way.

Can you please help me with this? :)

Many thanks  
Malik

---

<div class="post-metadata">

**Author:** ![andrew\_bowman](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/andrew_bowman/32/73_2.png) [@andrew\_bowman](https://community.neo4j.com/u/andrew_bowman)\
**Post date:** [May 5, 2019, 5:16pm UTC](https://community.neo4j.com/t/problem-with-transforming-json-in-graph-db/7134/2 "2019-05-05T17:16:24Z")

</div>

> [@malik.sog](#):
>
> WITH "[https://api.meetup.com/UX-Basel-Meetups/events?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&status=past](https://api.meetup.com/UX-Basel-Meetups/events?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&status=past)" AS url CALL apoc.load.json(url) YIELD value

Can you provide an example of the JSON returned? Take a look at it yourself, it is indeed a map, so you'll need to figure out what keys are important to you, and what map entries are lists that you'll want to UNWIND instead (UNWIND can only operate on lists...it changes a row with a list such that there is a separate row per list entry...basically the opposite of a collect()).

---

<div class="post-metadata">

**Author:** ![malik.sog](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/malik.sog/32/4671_2.png) [@malik.sog](https://community.neo4j.com/u/malik.sog)\
**Post date:** [May 5, 2019, 5:43pm UTC](https://community.neo4j.com/t/problem-with-transforming-json-in-graph-db/7134/3 "2019-05-05T17:43:18Z")

</div>

> [@andrew\_bowman](#):
>
> [https://api.meetup.com/UX-Basel-Meetups/events?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&status=past](https://api.meetup.com/UX-Basel-Meetups/events?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&status=past)

Thanks for the answer.

I want to completely unwind the JSON. The thing is, the outermost element has no key. (For the rest, I can address inner elements with the key without any problems.) Do you have a tip how I can solve this?

Here is the JSON:

```auto
[
{"created":1544476733000,"duration":7200000,"id":"257113229","name":"UX Meetup Februar" },

{"created":1549386834000, "duration": 7200000, "id":"258704617","name":"UX Meetup März"},
....... 
]

```

---

<div class="post-metadata">

**Author:** ![andrew\_bowman](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/andrew_bowman/32/73_2.png) [@andrew\_bowman](https://community.neo4j.com/u/andrew_bowman)\
**Post date:** [May 6, 2019, 7:39pm UTC](https://community.neo4j.com/t/problem-with-transforming-json-in-graph-db/7134/4 "2019-05-06T19:39:42Z")

</div>

Ah, in that case try using the procedure `apoc.load.jsonArray()` instead, that should have a YIELDED value that can be a list rather than a map, you should be able to UNWIND it.
