Single Field Indexes with dot notation

If I have an index like the one in the lesson {“subdoc.IndexField”}, if I try to query only the subdoc will it use the index?

It would only use whatever field you’ve indexed. In your case, only when you use IndexField.


Hi @LuisVibranovski,

Following on @007_jb’s reply. You can read more details here:

If you are want index to be used to subdoc field as a whole, you can create an index on {subdoc: 1}. If not, then it will only use index when queried on the indexed field {“subdoc.IndexField”}.


Thanks for your answer!

1 Like