# Exercise 3.3 CODE HELP

**URL:** <https://community.neo4j.com/t/exercise-3-3-code-help/18304>\
**Category:** Graph Academy\
**Created:** [May 7, 2020, 8:10pm UTC](https://community.neo4j.com/t/exercise-3-3-code-help/18304 "2020-05-07T20:10:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eschuck](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/eschuck/32/5752_2.png) [@eschuck](https://community.neo4j.com/u/eschuck)\
**Post date:** [May 7, 2020, 8:10pm UTC](https://community.neo4j.com/t/exercise-3-3-code-help/18304/1 "2020-05-07T20:10:33Z")

</div>

Looking to create code for Exercise 3.3 for the below question:

\*\*\* Retrieve all people connected with a particular movie.\*\*

Inputted the below code but received an error

**MATCH (p:Person)-\>(:Movie {title:"A League of their Own"}) Return p**

What am I doing wrong?

Thank you to anyone who can help

---

<div class="post-metadata">

**Author:** ![mdfrenchman](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mdfrenchman/32/6094_2.png) [@mdfrenchman](https://community.neo4j.com/u/mdfrenchman)\
**Post date:** [May 9, 2020, 1:24am UTC](https://community.neo4j.com/t/exercise-3-3-code-help/18304/2 "2020-05-09T01:24:10Z")

</div>

> [@eschuck](#):
>
> MATCH (p:Person)-\>(:Movie {title:"A League of their Own"}) Return p

Missing a second `-` in the rel. `—>` vs `->`  
Can also leave off the arrow to potentially grab relationships that go the other direction. I haven’t touched that dataset in a while so that may not make a difference in the result.

Best of luck!

---

<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 11, 2020, 12:27am UTC](https://community.neo4j.com/t/exercise-3-3-code-help/18304/3 "2020-05-11T00:27:50Z")

</div>

To clarify, when you only want to capture any relationship, but don't need to know it's type, properties, and you don't need variable-length relationships, and you don't need a variable on it, then two dashes are needed in the pattern:

```auto
(p:Person)-->(:Movie {title:"A League of their Own"})

```

This is because normally you would have something in the middle, such as the relationship type:

```auto
(p:Person)-[:ACTED_IN]->(:Movie {title:"A League of their Own"})

```

So when none of that is needed, everything in the square brackets can be dropped (along with the square brackets themselves) leading you just to the two dashes and direction (provided the direction is needed).

---

<div class="post-metadata">

**Author:** ![eschuck](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/eschuck/32/5752_2.png) [@eschuck](https://community.neo4j.com/u/eschuck)\
**Post date:** [May 12, 2020, 7:58pm UTC](https://community.neo4j.com/t/exercise-3-3-code-help/18304/4 "2020-05-12T19:58:50Z")

</div>

> [@andrew\_bowman](#):
>
> (p:Person)--\>(:Movie {title:"A League of their Own"})

Thank you very much for this! I will try these solutions.

---

<div class="post-metadata">

**Author:** ![eschuck](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/eschuck/32/5752_2.png) [@eschuck](https://community.neo4j.com/u/eschuck)\
**Post date:** [May 12, 2020, 7:59pm UTC](https://community.neo4j.com/t/exercise-3-3-code-help/18304/5 "2020-05-12T19:59:17Z")

</div>

Thank you very much! I will test this out.
