title: Get index of given element in array field in MongoDB
body: <p>Think of this MongoDB document:</p>
  
  <pre><code>{_id:123, "food":[ "apple", "banana", "mango" ]}
  </code></pre>
  
  <p>Question: How to get the position of <code>mango</code> in food? </p>
  
  <p>The query should return <code>2</code> in above, and don't return the whole document.</p>
  
  <p>Please kindly show the working query.</p>