title: MongoDB search to return only specific fields
body: <p>I'm using the <code>$text</code> feature in MongoDB to search for certain words and want the result to return not the entire document but only the specific fields where this word appears. </p>
  
  <p>I've created the <code>Text index</code>:</p>
  
  <pre><code>db.Info.ensure_index(
       [("Expenses.description", 'text'),
        ("fullName_normal", 'text')],
       name="searchAll"
   )
  </code></pre>
  
  <p>and do the search as below:</p>
  
  <pre><code>text_results = db.Info.find_one({'$and': [{'$text': {'$search': "Hello"}, 'Username': 'John Doe'}]})   
  </code></pre>
  
  <p>This returns the whole document only and I only want the specific fields where 'Hello' occurs.</p>
  
  <p>The document is as below:</p>
  
  <pre><code>{ 
  "_id": {
      "$oid": "54eb8555ccab9321bca808bf"
   },
   "fullName_normal": "username Hello",
   "Expenses":[
          {"description": "Hello",
           "Title": "Widgets",
           "ExpID": "mrsjxKvcSISbFQSSFvZI9g==",
           "Paid": "yes"
  
          }
      ],
    "Username": "John Doe",
    "Supplier": "no" 
  }
  </code></pre>