# How to ensure/drop indices?

Ensure Indices

  • To ensure indices of a specific collection, run command collection ensureIndices <collectionName>

    [Lottery] $ LotteryMongo/collection ensureIndices Lottery
    
  • To ensure indices of all collections defined inside a mongo module, run command collection ensureAllIndices

    [Lottery] $ LotteryMongo/collection ensureAllIndices
    
  • To ensure indices of all collections in the project, run command ensureAllIndices

    [Lottery] $ ensureAllIndices
    

Drop Indices

  • To drop indices of a specific collection, run command collection dropIndices <collectionName>

    [Lottery] $ LotteryMongo/collection dropIndices Lottery
    
  • To ensure indices of all collections defined inside a mongo module, run command collection dropAllIndices

    [Lottery] $ LotteryMongo/collection dropAllIndices
    
  • To drop indices of all collections in the project, run command dropAllIndices

    [Lottery] $ dropAllIndices