title: How do I search for elements whose collection contains another element in Grails?
body: <p>Let's say I have a domain class called "User" which can follow other "User" objects. It does so having a field specified as:</p>
  
  <pre><code>def hasMany=[followedUsers:User]
  </code></pre>
  
  <p>I need to do the reverse (find all User objects that follow a specific User object) without setting up the reverse relationship, since it is not a use case performed often. I tried to do something like this, using closures:</p>
  
  <pre><code>User.findAll { it.followedUsers.contains(userInstance) }
  </code></pre>
  
  <p>but this always returns all users in the database, regardless of their follow status. I tried doing with HQL but failed miserably as well.</p>
  
  <p>Could anyone give me a quick pointer on the simplest way to accomplish this? Thank you.</p>