Skip to main content

No project description provided

Project description

MongoDB fields Cleaner

PyPI Version codecov

It simplifies the process of cleaning up old deprecated fields in a MongoDB database.

This will help you to easily remove obsolete/unused fields in your MongoDB collections so that you can save space in your DB.

How to use it

It is as simple as getting a pymongo.MongoClient and pass it to the Cleaner constructor.

Once we have the Cleaner object instance, we just need to call the clean method with the collection name and the field names we want to keep (unset), the fields not in this collection will be removed. This call will return an UpdateResult object.

from mdb_fields_cleaner import Cleaner

client = MongoClient()
cleaner = Cleaner(client)

results: UpdateResult = cleaner.clean(collection.name, ["make", "model"])
print(f"{results.modified_count} modified documents")

Development flow

  1. Create a branch and a pull request.
  2. Label the pull request with the correct semver label: patch, minor, major.
  3. Get the PR approved and merged.

At this point the package should be published in Pypi.org registry.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdb_fields_cleaner-0.0.17.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdb_fields_cleaner-0.0.17-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file mdb_fields_cleaner-0.0.17.tar.gz.

File metadata

  • Download URL: mdb_fields_cleaner-0.0.17.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for mdb_fields_cleaner-0.0.17.tar.gz
Algorithm Hash digest
SHA256 12c3026a669db1b482df8720dc3001263b1e6fc63715cea79104a92cd1f7bc80
MD5 fe26d9e219c4a7b355c63114de1b4724
BLAKE2b-256 a45a9d74f1d9d9e47417e09444831e2ea70afc6a5b9355336f37b540e79212b8

See more details on using hashes here.

File details

Details for the file mdb_fields_cleaner-0.0.17-py3-none-any.whl.

File metadata

File hashes

Hashes for mdb_fields_cleaner-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 fc98abd5477af0482c1cc96df35edc9c427a7895dd6873ff00c2d39bf549995f
MD5 dfb13fb162aa4058d4a539444eca20df
BLAKE2b-256 8e00fbc67d4ea4fc94315f1278ad8ef22639e404d20fdf5b10612f86a6e9b5dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page