1

Can somebody tell me please if is possible to get detailed info about indexes in Mongodb? I need to show the time when index was created. But command:

db.getCollection('collectionName').getIndexes()

does not show this information. Is there any way do it? Thanks.

Čamo
  • 3,863
  • 13
  • 62
  • 114
  • 2
    MongoDB does not store such information as a "creation date" of the index. The most detailed information you can get is from `db.getCollection('collectionName').stats({ indexDetails: true }).indexDetails` to just narrow down the "index parts" of the full collection stats. Nothing in there about creation date. You can use `db.getCollection('collectionName').aggregate({ "$indexStats": {} })` to return things like "access statistics" on collection indexes, but again this does not return a "creation date". – Neil Lunn May 05 '19 at 11:42
  • 1
    Also, this does not really seem like a "programming" question unless you are creating a tool for administering MongoDB data. Database administration questions should be asked on https://dba.stackexchange.com instead. – Neil Lunn May 05 '19 at 11:43
  • If I want to find command it is programming question. – Čamo May 05 '19 at 13:45

0 Answers0