DEV Community

DenyS
DenyS

Posted on

I made a MongoDB migration tool

Hi Everyone! I made a MongoDB migration tool. Mongorunway designed to help users make the migration process as easy and convenient as possible.

Easy to use:

from __future__ import annotations

import typing

import mongorunway

# Required, used by Mongorunway.
version = 1


@mongorunway.migration
def upgrade() -> typing.List[mongorunway.MigrationCommand]:
    return [  # List of commands to upgrade
        mongorunway.create_collection("abc"),
    ]


@mongorunway.migration
def downgrade() -> typing.List[mongorunway.MigrationCommand]:
    return [  # List of commands to downgrade
        mongorunway.drop_collection("abc"),
    ]
Enter fullscreen mode Exit fullscreen mode

The tool also has many other useful components, more details on the project documentation website.

Documentation: https://animatea.github.io/mongorunway/
GitHub: https://github.com/Animatea/mongorunway

Top comments (0)