I use the following cypher to get all the entities of the label User:

```
MATCH (u:User)
OPTIONAL MATCH (u)-[r:RATED]->(m:Movie) 
WITH u,r,m
RETURN u.id as uid, m.id as mid, r.rating as rating

```

This returns me an array of objects formatted as:

```
[
    {
      "uid": "user1",
      "mid": "bettercallsaul",
      "rating": 9
    },
    {
      "uid": "user1",
      "mid": "breakingbad",
      "rating": 10
    }
    // ... etc
]

```

I would like however to group it by the `u.id` (or `uid`) such that it returns something like (or similar):

```
[
   {"user1": 
       {"mid": "bettercallsaul", "rating": 9},
       {"mid": "breakingbad", "rating": 10},
       // ... etc
   },
   {"user2":
       {"mid": "breakingbad", "rating": 7},
       {"mid": "bettercallsaul", "rating": 8},
       // ... etc
   }
   // ... etc
]

```