Grokking MongoDB
Vote

0% completed

​

Index Types

The value written next to a field name in createIndex() decides what MongoDB stores in the index: 1 or -1 stores the value itself, "text" stores individual words, "hashed" stores a hash, and "2dsphere" stores a position on the Earth. Two more kinds, multikey and wildcard, depend on the data or on a special field name. Each kind exists for a query or a use that the others do not serve as well.

The examples add indexes to one library collection, so you can compare what each index does with the same data. We follow one book, To Kill a Mockingbird, through each index:

``

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content