To list all indexes in MongoDB,
you can do the following:
> db.someCollection.getIndexes()                                                                                
[
        {
                "v" : 1,
                "key" : {
                        "_id" : 1
                },
                "name" : "_id_",
                "ns" : "test.someCollection"
        },
        {
                "v" : 1,
                "key" : {
                        "someIndexProperty" : 1
                },
                "name" : "someIndexProperty_1",
                "ns" : "test.someCollection"
        }
]
>
Reference:
http://docs.mongodb.org/manual/tutorial/list-indexes/
No comments:
Post a Comment