Skip to main content

No project description provided

Project description

MongoDB fields Cleaner (WIP)

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.16.tar.gz (2.6 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.16-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mdb_fields_cleaner-0.0.16.tar.gz
  • Upload date:
  • Size: 2.6 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.16.tar.gz
Algorithm Hash digest
SHA256 e962997d77e5ebb4d3ca03e132e78e1e70a0090f09dc4baba8845ea2a7e72f6a
MD5 b1974c51c1e9080faa9135fafa7c8211
BLAKE2b-256 20c985884bb4f4452460e4f40237e1d4e5ad68c87d832f16ed6c8a3fcce7b30b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mdb_fields_cleaner-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 1b9cdb43d7c991789b33d5be29c5dac9491048ea13f6d9920e5fe857bd4b4c44
MD5 5b2fa2df3d502ef001de0fdc694cb375
BLAKE2b-256 f6c4bc689acc9fbfda17c624fac1ee7035f7cb47f2f50efdb073be0b0788a946

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