Search code examples
mongodbmongodb-indexes

What exactly happens when you 'index' a MongoDB database?


So I understand that indexes are crucial because they allow you to make queries without having to look at the entire collection, but what exactly is an index? What really happens to the data when you call .createIndex()? Thanks!


Solution

  • Think this should help you

    https://www.youtube.com/watch?v=U3iWPF5jP-g&feature=youtu.be

    HTH.