title: Implement auto-complete feature using MongoDB search
body: <p>I have a <code>MongoDB</code> collection of documents of the form</p>
  
  <pre><code>{
      "id": 42,
      "title": "candy can",
      "description": "canada candy canteen",
      "brand": "cannister candid",
      "manufacturer": "candle canvas"
  }
  </code></pre>
  
  <p>I need to implement auto-complete feature based on the input search term by matching in the fields except <code>id</code>. For example, if the input term is <code>can</code>, then I should return all matching <strong>words</strong> in the document as</p>
  
  <pre><code>{ hints: ["candy", "can", "canada", "canteen", ...]
  </code></pre>
  
  <p>I looked at <a href="https://stackoverflow.com/questions/8223841/implement-autocomplete-on-mongodb">this question</a> but it didn't help. I also tried searching how to do <code>regex</code> search in multiple fields and extract matching tokens, or extracting matching tokens in a MongoDB <code>text search</code> but couldn't find any help. </p>