# Search and filter a specific node DQL

**URL:** <https://discuss.dgraph.io/t/search-and-filter-a-specific-node-dql/16132>\
**Category:** Users\
**Created:** [November 24, 2021, 9:41am UTC](https://discuss.dgraph.io/t/search-and-filter-a-specific-node-dql/16132 "2021-11-24T09:41:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![farid](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@farid](https://discuss.dgraph.io/u/farid)\
**Post date:** [November 24, 2021, 9:41am UTC](https://discuss.dgraph.io/t/search-and-filter-a-specific-node-dql/16132/1 "2021-11-24T09:41:23Z")

</div>

I have a node that expands to multiple different nodes with a @recurse(depth:xx)  
but i want to only get to a specific node,

so it should be a search and filter process, but not sure why its driving me nuts

```auto
{

relationship(func: eq(name, "Alice")) @recurse(depth:3) 

  @filter(eq(name,"Ethan"))
{
  name
friend
}
}

```

the above is what i tried, but am not getting any data

the mutation is as below

```auto
{
  set {
    _:a <friend> _:b .
    _:a <friend> _:c .
    _:a <friend> _:d .
    _:b <friend> _:d .
    _:a <friend> _:e .
    _:b <friend> _:e .
    _:a <friend> _:f .
    _:a <friend> _:bb .
    _:bb <friend> _:c .
    _:a <name> "Alice" .
    _:a <dgraph.type> "Person" .
    _:b <name> "Bob" .
    _:b <dgraph.type> "Person" .
    _:bb <name> "Bobby" .
    _:bb <dgraph.type> "Person" .
    _:c <name> "Chow" .
    _:c <dgraph.type> "Person" .
    _:d <name> "Danny" .
    _:d <dgraph.type> "Person" .
    _:e <name> "Ethan" .
    _:e <dgraph.type> "Person" .
    _:f <name> "Francis" .
    _:f <dgraph.type> "Person" .
   
  }
}

```

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [November 24, 2021, 4:45pm UTC](https://discuss.dgraph.io/t/search-and-filter-a-specific-node-dql/16132/2 "2021-11-24T16:45:36Z")

</div>

Maybe something like this

```auto
{
U as var(func: eq(name, "Alice")) @recurse(depth:3) {
  friend #You can add the U var here instead too
}

q(func: uid(U)) @filter(eq(name,"Ethan")) {
  name
  friend
}
}

```

---

<div class="post-metadata">

**Author:** ![farid](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@farid](https://discuss.dgraph.io/u/farid)\
**Post date:** [November 25, 2021, 1:13am UTC](https://discuss.dgraph.io/t/search-and-filter-a-specific-node-dql/16132/3 "2021-11-25T01:13:09Z")

</div>

The above does not return me anything.  
The below query works for me, only thing is if i have 10 different types of relationships, then for each i would need to add the “@filter…”

{  
relationship(func: eq(name,“Alice”)) @recurse(depth:3) {  
name  
friend @filter(eq(name,“Ethan”))  
}  
}
