comment ajouter des index aux collections existantes mongodb

//createIndex adds creates new indexing to existing collections indexes

db.collection.createIndex(
  {
      "a": 1
  },
  {
      unique: true,
      sparse: true,
      expireAfterSeconds: 3600
  }
)
Upvote answer :-)