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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mongoose-copy-data

v2.5.2

Published

A utility for copying data between MongoDB collections using Mongoose inside terminal only

Downloads

39

Readme

Database Copy Utility (CLI Tool)

Database Copy Utility (CLI Tool)

A utility package for copying data between MongoDB collections using Mongoose.

Table of Contents

Overview

The Database Copy Utility is a command-line interface (CLI) tool designed to facilitate the copying of data between two MongoDB databases. This tool allows users to specify source and target database connection strings and select specific collections to copy. It handles the connection to both databases, provides options for selecting collections, and copies data efficiently.

Prerequisites

Before using this tool, ensure that you have the following prerequisites installed:

  • Node.js
  • npm (Node Package Manager)
  • MongoDB

Installation

You can install the Database Copy Utility globally using npm:

  npm install -g mongoose-copy-data

Running the Tool

Once installed, you can run the tool in your terminal as follows:

mongoose-copy-data

Important Notice

1. First, it will delete all data from the target collections you have selected, and then it will copy all the data into the target database.
 
2. It will not make any changes to the collections in the source database.

Usage Steps

  1. When you run the tool, it will prompt you to enter the source and target database connection strings.

  2. After successfully connecting to both databases, you can choose whether to copy all collections or select specific collections to copy.

  3. If you choose the all collections, You will be presented with a list available collection to exclude the collections if you want. if you want to copy whole collection then press enter.

  4. If you choose to copy specific collections, you will be presented with a list of available collections to choose from.

  5. The tool will confirm your selections before proceeding with the data copy.

  6. It will then copy the selected data from the source database to the target database, providing progress updates along the way. Additionally, you can view the uploaded document's size and a progress bar.

  7. Once the data copy is complete, the tool will display a success message for each copied collection.

Dependencies

The tool relies on several Node.js packages for its functionality:

  • mongoose : MongoDB object modeling for Node.js.

  • inquirer : A collection of common interactive command-line user interfaces.

  • cli-progress : easy to use progress-bar for command-line/terminal applications.

  • figlet : Creates ASCII Art from text.

Configuration

Before using this package, make sure to configure the following environment variables:

  • SOURCEDATABASE: Connection URL for the source MongoDB database.
  • DESTINATIONDATABASE: Connection URL for the target MongoDB database.

Author

This Database Copy Utility was created by Gautam Kumar.

Feel free to adjust the content of the `readme.md` file as needed. This provides a comprehensive guide to compy the database collection into the other.

Package Information

  • Package Name: mongoose-copy-data
  • Author Name: gautamtheprogrammer
  • GitHub URL: https://github.com/gautamlovecoding/mongoose-copy-data