dokku / dokku-mongo

a mongo plugin for dokku
MIT License
177 stars 32 forks source link

--repair #103

Closed AlexBlokh closed 3 years ago

AlexBlokh commented 6 years ago

Is there any way I can run mongod --repair... on mongo instance through dokku ??

JDR42 commented 6 years ago

+1 In general it would be nice to be able to run mongo commands at the admin level from the command line to perform automated maintenance. It appears mongo:connect-admin does not allow for this. For example, db.products.reIndex();

josegonzalez commented 6 years ago

Pull requests welcome.

josegonzalez commented 3 years ago

The db.repairDatabase() function is no longer available in mongodb 5 (what we support) and the db.products.reIndex() call appears to work fine from a mongo:connect-admin session for me:

root@0872a69de680:/workspaces/mongo# dokku mongo:connect-admin test
> db.products.reIndex()
{
        "nIndexesWas" : 1,
        "nIndexes" : 1,
        "indexes" : [
                {
                        "v" : 2,
                        "key" : {
                                "_id" : 1
                        },
                        "name" : "_id_"
                }
        ],
        "ok" : 1
}

Going to close this for now, but feel free to open a new issue if this is still causing problems.