{"id":13480822,"url":"https://github.com/jwilder/mongodb-tools","last_synced_at":"2025-04-07T16:18:54.913Z","repository":{"id":2053040,"uuid":"2990860","full_name":"jwilder/mongodb-tools","owner":"jwilder","description":"Tools for working w/ a MongoDB installation","archived":false,"fork":false,"pushed_at":"2020-03-12T17:03:34.000Z","size":44,"stargazers_count":297,"open_issues_count":7,"forks_count":58,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-31T14:13:05.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwilder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-15T21:56:14.000Z","updated_at":"2025-03-27T21:31:52.000Z","dependencies_parsed_at":"2022-09-20T04:41:37.287Z","dependency_job_id":null,"html_url":"https://github.com/jwilder/mongodb-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilder%2Fmongodb-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilder%2Fmongodb-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilder%2Fmongodb-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilder%2Fmongodb-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwilder","download_url":"https://codeload.github.com/jwilder/mongodb-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:00:45.447Z","updated_at":"2025-04-07T16:18:54.894Z","avatar_url":"https://github.com/jwilder.png","language":"Python","funding_links":[],"categories":["Tools"],"sub_categories":["Administration"],"readme":"## mongodb-tools - Utilities for working with MongoDB\n\n* collection-stats.py - Display statistics about the collections in all databases\n* index-stats.py - Displays statistics about the indexes in all databases\n* redundant-indexes.py - Finds indexes that may be redundant\n\n## Blogs And Articles\n\n* [Optimizing MongoDB Indexes](http://jasonwilder.com/blog/2012/02/08/optimizing-mongodb-indexes/)\n* [Design and Performance Tips for MongoDB Indexes](https://www.openshift.com/blogs/design-and-performance-tips-for-mongodb-indexes)\n\n## Dependencies\n\n    python-virtualenv\n    python-dev\n\n## Installation\n\n    git clone https://github.com/jwilder/mongodb-tools\n    cd mongodb-tools\n    ./setup.sh\n    source virtualenv/bin/activate\n\n## Test Data Setup\n\n    In on terminal run:\n\n    $ ./run-mongo.sh\n\n\n    In another terminal run:\n\n    $ python examples/testdata.py\n\n\n## collection-stats.py ##\n\n     $ ./collection-stats.py\n\n     Checking DB: examples2.system.indexes\n     Checking DB: examples2.things\n     Checking DB: examples1.system.indexes\n     Checking DB: examples1.address\n     Checking DB: examples1.typeless_address\n     Checking DB: examples1.user\n     Checking DB: examples1.typeless_user\n\n\n     +----------------------------+--------+--------+---------+--------------+---------+------------+\n     |         Collection         | Count  | % Size | DB Size | Avg Obj Size | Indexes | Index Size |\n     +----------------------------+--------+--------+---------+--------------+---------+------------+\n     | examples1.address          |      2 |   0.0% | 184.00b |       92.00b |    2    |     15.97K |\n     | examples1.system.indexes   |      9 |   0.0% | 912.00b |      101.33b |    0    |      0.00b |\n     | examples1.typeless_address |      2 |   0.0% | 216.00b |      108.00b |    1    |      7.98K |\n     | examples2.system.indexes   |      2 |   0.0% | 164.00b |       82.00b |    0    |      0.00b |\n     | examples1.typeless_user    | 101879 |  26.7% |  10.10M |      104.00b |    3    |      8.18M |\n     | examples1.user             | 101879 |  36.0% |  13.60M |      140.00b |    3    |     15.20M |\n     | examples2.things           | 100000 |  37.3% |  14.11M |      148.00b |    2    |      5.67M |\n     +----------------------------+--------+--------+---------+--------------+---------+------------+\n     Total Documents: 303773\n     Total Data Size: 37.82M\n     Total Index Size: 29.08M\n     RAM Headroom: 2.87G\n     RAM Used: 2.74G (61.6%)\n     Available RAM Headroom: 1.10G\n\n## index-stats.py\n\n    $ ./index-stats.py\n    \n\n    Checking DB: examples2.system.indexes\n    Checking DB: examples2.things\n    Checking DB: examples1.system.indexes\n    Checking DB: examples1.address\n    Checking DB: examples1.typeless_address\n    Checking DB: examples1.user\n    Checking DB: examples1.typeless_user\n\n    Index Overview\n    +----------------------------+------------------------+--------+------------+\n    |         Collection         |         Index          | % Size | Index Size |\n    +----------------------------+------------------------+--------+------------+\n    | examples1.address          | _id_                   |   0.0% |      7.98K |\n    | examples1.address          | _types_1               |   0.0% |      7.98K |\n    | examples1.typeless_address | _id_                   |   0.0% |      7.98K |\n    | examples1.typeless_user    | _id_                   |  10.9% |      3.17M |\n    | examples1.typeless_user    | address_id_1           |  10.9% |      3.17M |\n    | examples1.typeless_user    | typeless_address_ref_1 |   6.4% |      1.85M |\n    | examples1.user             | _id_                   |  10.9% |      3.17M |\n    | examples1.user             | _types_1_address_id_1  |  13.2% |      3.84M |\n    | examples1.user             | _types_1_address_ref_1 |  28.2% |      8.20M |\n    | examples2.things           | _id_                   |  10.7% |      3.11M |\n    | examples2.things           | _types_1               |   8.8% |      2.56M |\n    +----------------------------+------------------------+--------+------------+\n\n    Top 5 Largest Indexes\n    +-------------------------+------------------------+--------+------------+\n    |        Collection       |         Index          | % Size | Index Size |\n    +-------------------------+------------------------+--------+------------+\n    | examples1.user          | _types_1_address_ref_1 |  28.2% |      8.20M |\n    | examples1.user          | _types_1_address_id_1  |  13.2% |      3.84M |\n    | examples1.typeless_user | _id_                   |  10.9% |      3.17M |\n    | examples2.things        | _id_                   |  10.7% |      3.11M |\n    | examples2.things        | _types_1               |   8.8% |      2.56M |\n    +-------------------------+------------------------+--------+------------+\n\n    Total Documents: 303773\n    Total Data Size: 37.82M\n    Total Index Size: 29.08M\n    RAM Headroom: 2.87G\n    RAM Used: 2.73G (61.4%)\n    Available RAM Headroom: 1.11G\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwilder%2Fmongodb-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwilder%2Fmongodb-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwilder%2Fmongodb-tools/lists"}