npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mongograte

v2.4.0

Published

Tool for migrating MongoDB to MongoDB

Downloads

28

Readme

mongograte

License: MIT Release

A robust tool for seamless migration of data between MongoDB databases, allowing for efficient synchronization, with support for listening to live changes in the source database.

  1. :notebook_with_decorative_cover: Description
  2. :warning: Before running
  3. :hammer: Installation
  4. :writing_hand: Usage
  5. :bookmark_tabs: Options
  6. :monocle_face: Examples
  7. :page_with_curl: License
  8. :heart: Contribution

# Description

mongograte is a command-line tool designed to facilitate the migration of MongoDB collections and databases from a source server to a target server. It supports options for clearing existing data, limiting the number of documents to migrate, and listening to changes for real-time synchronization.

# Before Running

N/A

# Installation

npm i -g mongograte

# Usage

Basic usage example:

mongograte -d myDatabases -s mongodb://host:port -t mongodb://host:port

You can see default values in options section

# Options

The following command-line options are supported:

| Option | Description | Type | Required | Default value | |-----------------|---------------------------------------------------------------|---------------|------------|----------------| | -d, --databases | List of target databases to migrate | array | Yes | - | | -s, --source | Source MongoDB server URI | string | Yes | - | | -t, --target | Target MongoDB server URI | string | Yes | - | | --migrate-collections | Collections to migrate from the source database | string | No | - | | --ignore-collections | Collections to exclude from the migration process | string | No | - | | --drop | Drop target collections in the target database before migration | boolean | No | false | | --drop-all | Drop all collections in the target database before migration | boolean | No | false | | --truncate | Truncate target collections in the target database before migration | boolean | No | true | | -l, --limit | Maximum number of records to migrate per collection | number | No | 1000 | | --query-limit | Maximum number of records per query | number | No | 1000 | | --timeout | Timeout for MongoDB connection (ms) | number | No | 5000 | | --listen | Enable real-time synchronization of source database changes | boolean | No | false | | -i, --insecure | Allow using a remote database as the target | boolean | No | false | | --skip-update | Skip checking for updates | boolean | No | false | | -v, --version | Show version number | boolean | No | - | | -h, --help | Display help information | boolean | No | - |

# Examples

Migrating a Database with Specific Options

To migrate the testDB from a local server to a remote server with the collection drop option enabled and a limit of 500 records, use:

mongograte -d testDB -s mongodb://localhost:port -t mongodb://remotehost:port --drop -l 500

Real-Time Synchronization

To listen for changes in the source database and apply them to the target, use the --listen flag:

mongograte -d myDatabase -s mongodb://host:port -t mongodb://host:port --listen

This will keep your target database in sync with the source in near real-time.

# License

Distributed under the MIT License. See LICENSE for more information.

# Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

:star: Feel free to contribute :star: