There are several ways to create an index in MongoDB, and from MongoDB 4.2, we can create wildcard indexes.
A wildcard index can be thought of as a kind of filter that automatically matches any field, sub-document or array in a collection and then indexes those matches.
Continue reading