title: Search a collection of objects
body: <p>I'm trying to search for a collection of potential nodes but unable to do it...
  I have a product that has a relationship with many instances. I would like to query the DB and get all the instances that are in a list that i get from the user.</p>
  
  <p>Cypher:</p>
  
  <pre><code>var query = _context
   .Cypher
   .Start(new
   {
     instance = startBitsList,
     product = productNode.Reference,
   })
   .Match("(product)-[:HasInstanceRel]-&gt;(instance)")
   .Return(instance =&gt; instance.Node&lt;ProductInstance&gt;());
  </code></pre>
  
  <p>The problem is startBitsList... I use StringBuilder to generate a query that contains all the instances I'm looking for:</p>
  
  <pre><code>private static string CreateStartBits(IEnumerable&lt;string&gt; instanceNames)
   {
     var sb = new StringBuilder();
     sb.AppendFormat("node:'entity_Name_Index'(");
     foreach (var id in productIds)
     {
       sb.AppendFormat("Name={0} OR ", id);
     }
     sb.Remove(sb.Length - 4, 4);
     sb.Append(")");
  
    var startBitsList = sb.ToString();
    return startBitsList;
  }
  </code></pre>
  
  <p>I get exceptions when trying to run this cypher...
  Is there a better way to search for multiple items that are stored in the collection I get from the user?</p>