1.0.4 • Published 7 months ago

mongo-data-transfer v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

mongo-data-transfer

A simple tool to transfer data between two MongoDB databases.

Installation

Install the package using npm:

npm install mongo-data-transfer

## Usage
Use the package programmatically in your Node.js or TypeScript project.


import { transferData } from "mongo-data-transfer";

const sourceUri = "mongodb://user:pass@source-host:27017/sourceDB";
const destinationUri = "mongodb://localhost:27017/destinationDB";

async function run() {
  try {
    await transferData(sourceUri, destinationUri);
    console.log("Data transfer completed successfully!");
  } catch (error) {
    console.error("Data transfer failed:", error.message);
  }
}

run();

## Features

- ✅ **Easy-to-use API**: Transfer data between MongoDB databases with a single **function** call.
- ✅ **Duplicate Handling**: Automatically skips duplicate records based on `_id`.
- ✅ **Efficient Data Transfer**: Handles large collections without performance issues.
- ✅ **TypeScript Support**: Fully typed with TypeScript for better developer experience.
- ✅ **System Collections Ignored**: Automatically skips `system.*` collections.
1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago