To add to Avish's answer, such an index comprising of more than one fields is called a compound index. The order of the fields listed in a compound index is quite important. Here is why:
The index will contain references to documents sorted first by the values of the first field and, within each value of the first field, sorted by values of the second field and, within each value of the second field, sorted by values of the third field, and so on.
For example in your case, index will contain references to documents sorted first by the values of the propA field and, within each value of the propA field, sorted by values of the propB field and, within each value of the propB field, sorted by values of the propC field.
So keep in mind that while following queries will use the given index:
- db.collection.find({propA:'z'})
- db.collection.find({propB:'x', propC: 'y', propA:'z'})
- db.collection.find({propB:'x', propA:'z'})
The following can't use the given index:
- db.collection.find({propB:'x'})
- db.collection.find({propC:'y'})
- db.collection.find({propB:'x', propC: 'y'})