title: What is the complexity (Big-O) of searching an indexed data in mongoDB?
body: <p>This is for a design issue. Can you tell me if i am indexing the key words as shown below.</p>
  
  <pre><code>obj = {
      name: "Apollo",
      text: "Some text about Apollo moon landings",
      tags: [ "moon", "apollo", "spaceflight" ]
  }
  </code></pre>
  
  <p>Ensuring index  like this .</p>
  
  <pre><code>db.articles.ensureIndex( { tags: 1 } );
  </code></pre>
  
  <p>and  frequent query as follows.</p>
  
  <pre><code>db.articles.findOne( { tags: "apollo" } ).name
  </code></pre>
  
  <p>Please give me the performance of such query if i have n such documents inserted.</p>
  
  <p>is it O(1) ?</p>
  
  <p>And what is the performance for searching a regular expressions on such data.?</p>