I have a mongodb database with about 2 billion records, shared between 20 or so collections. Each of these collections has an index on it, based on a single key (other than _id).
I have an index file (named index-1-5374774422504609475.wt) that I’d like to match to a collection. Is there a quick way to match directly which index file corresponds to a collection?
I do mean the actual physical index file in the mongo db directory.
Thanks in advance!
As you are using WiredTiger storage engine you can use
indexDetails option set to
Easy copy paste:
A document that reports data from the WiredTiger storage engine for
each index in the collection. Other storage engines will return an
The fields in this document are the names of the indexes, while the
values themselves are documents that contain statistics for the index
provided by the storage engine. These statistics are for internal