v0.8.1: Sync Indexes
Mongoose Studio v0.8.1 adds a "Sync Indexes" button to the indexes modal, so you can make the indexes in MongoDB match the indexes in your Mongoose schema. It creates schema indexes that aren't in MongoDB, and drops indexes that are in MongoDB but not in your schema.
Confirm before you sync
Clicking "Sync Indexes" opens a modal that lists exactly which indexes will be created and dropped.
Mongoose Studio uses Mongoose's diffIndexes() to calculate these lists, but it does not use Mongoose's syncIndexes().
That's because the indexes you confirm should be the ones that get built or dropped, even if the indexes change after the modal loaded.
Syncing is only available to owners and admins.
Read-only users cannot run syncIndexes().
If one index fails to build, for example because a unique index has duplicate values, Mongoose Studio shows the error and continues with the remaining indexes.
Track index build progress
Index builds on large collections can take a while, so the modal shows the status of each index as the sync runs. On MongoDB 8.2 and later, you also get a progress bar for each phase of the index build, like scanning the collection and inserting keys into the index. On older versions of MongoDB, and on Vercel and Netlify, you'll see which indexes are in progress and done, but you won't see the individual progress bars.