According to Mongoose documentation , the index should not be defined on the schema and should be disabled in production. I am confused as to what is being recommended. If index should not be defined in the mongoose schema then how it should be created in NodeJS app?
Asked
Active
Viewed 473 times
0
-
1Nothing wrong with defining the index in the schema. See here for a related question about what's likely confusing you: https://stackoverflow.com/questions/14342708/mongoose-indexing-in-production-code – JohnnyHK Aug 20 '16 at 22:49
-
As @JohnnyHK mentioned, the link (https://stackoverflow.com/questions/14342708/mongoose-indexing-in-production-code) clarified the confusion. – Vish Sep 03 '16 at 14:31