title: How to index mongoose fields in production mode, why should i disable autoindex feature?
body: <p>I am making an <code>android</code> app and I am using <strong>nodeJS</strong> with <strong>mongoDB</strong> on the server side, now actually till now I was coding all in development, but now I want my app to be in production, now as I read the docs on mongoose they have written that :</p>
  
  <blockquote>
    <p>When your application starts up, Mongoose automatically calls ensureIndex for each defined index in your schema. While nice for development, it is recommended this behaviour be disabled in production since index creation can cause a significant performance impact. Disable the behaviour by setting the autoIndex option of your schema to false</p>
  </blockquote>
  
  <p>Now can anyone please tell me what is this, I mean, I have some fields that I have indexed now why disable autoIndex, I am not indexing every field just some of them I have also seen this question before on <strong>StackOverflow</strong>, but no one explained this in detail, <strong>I have read the answers here</strong> </p>
  
  <p><a href="https://stackoverflow.com/questions/14342708/mongoose-indexing-in-production-code">Mongoose indexing in production code</a><br>
  <a href="https://stackoverflow.com/questions/20906679/mongoose-call-ensureindex-on-startup-but-its-not-recommended-so-why-its-defa?rq=1">Mongoose call ensureIndex on startup, but it's not recommended. So why it's default?</a></p>
  
  <p>Also one more question I was just wondering that as all my indexes are on my <strong>mongoDB</strong> part so what are the use of describing them even in schema level, I mean think this way every operation CRUD every thing happens on database and on database level we have defined all the indexes so why should we again index them at schema level please answer I am very new on this thats why didn't know much bout this I know I am missing some big part of the puzzle but it would be really helpful if someone can share some light on this.</p>