A list of indices in MongoDB ?



  • 3 Answer(s)

    Shell:

    db.test.getIndexes()
    

    see the below code:

    help;
    db.help();
    db.test.help();
    
    Answered on January 8, 2019.
    Add Comment

    You need to get all the list from your database:

    use "yourdbname"
    db.system.indexes.find()
    
    Answered on January 8, 2019.
    Add Comment

    You can use your collection:

    
    db.collection.getIndexes()
    
    

    http://docs.mongodb.org/manual/administration/indexes/#information-about-indexes

     

    Answered on January 8, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.