Docs Home → Develop Applications → Python Drivers → PyMongo
Wildcard Indexes![](/docs/languages/python/pymongo-driver/assets/link.svg)
On this page
Overview![](/docs/languages/python/pymongo-driver/assets/link.svg)
Wildcard indexes enable queries against unknown or arbitrary fields. These indexes can be beneficial if you are using a dynamic schema.
Sample Data![](/docs/languages/python/pymongo-driver/assets/link.svg)
The examples in this guide use the sample_mflix.movies
collection
from the Atlas sample datasets. To learn how to create a
free MongoDB Atlas cluster and load the sample datasets, see the
Get Started with PyMongo.
Create a Wildcard Index![](/docs/languages/python/pymongo-driver/assets/link.svg)
The following example creates an ascending wildcard index on all
values of the location
field, including values nested in subdocuments and arrays:
movies.create_index({ "location.$**": pymongo.ASCENDING })
For more information, see the Wildcard Indexes page in the MongoDB Server manual.