title: How to find a substring in a field in Mongodb
body: <p>How can I find all the objects in a database with where a field of a object contains a substring?</p>
  
  <p>If the field is A in an object of a collection with a string value:</p>
  
  <p>I want to find all the objects in the db "database" where A contains a substring say "abc def".</p>
  
  <p>I tried: </p>
  
  <pre><code>db.database.find({A: {$regex: '/^*(abc def)*$/''}})
  </code></pre>
  
  <p>but didn't work</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>A real string (in unicode):</p>
  
  <pre><code>Sujet  Commentaire sur  Star Wars  Episode III - La Revanche des Sith 1
  </code></pre>
  
  <p>Need to search for all entries with Star Wars</p>
  
  <pre><code>db.test.find({A: {$regex: '^*(star wars)*$''}}) not wokring
  </code></pre>