title: MondoDB+C#+IQueryable - have an array of strings and how to join it to Mongo's collection in the Where clause
body: <p>Having quite a small experience with Mongo, please help... I have Employee collection (fields are: FirstName, LastName, Title, etc) in the Mondo DB, using C# MongoDB driver and using the collection as IQueryable so I can search for the data by using LINQ.</p>
  <p>I need to perform a complex search in Mongo's Employee collection. For example, a user enters SearchText=&quot;John Doe CEO&quot;, code split this string into an array: [&quot;John&quot;, &quot;Doe&quot;, &quot;CEO&quot;]. The task is: if any field (FirstName OR LastName OR Title) contains any word from the array, the query should return it as a result.</p>
  <p>AFAIR, this statement works fine when I query a simple List:</p>
  <pre><code>collection.AsQueryable().Where(e =&gt; 
                      allWordsArr.Any(_ =&gt; e.FirstName.ToLower().StartsWith(_.ToLower())) ||
                      allWordsArr.Any(_ =&gt; e.LastName.ToLower().StartsWith(_.ToLower())) ||
                      allWordsArr.Any(_ =&gt; e.Title.ToLower().StartsWith(_.ToLower())))
  </code></pre>
  <p>but when I run the query on the real Mongo DB it fails due to an unsupported operator string[].Any... So I can't pass the array from the C# code into the Mongo DB and then - perform LINQ/search operations, based on the elements of the array provided... It seems like I can't use an array of strings as initial expression (allWordsArr.Any(...))</p>
  <p>How can I perform a search by using multiple fields and an array of words? I'd prefer to use collection.AsQueryable(..)+LINQ approach, but if it's not possible - any suggestion is welcome...</p>
  <p>Thanks a lot!</p>