# update-mongo-db

> program for update type or name of field in mongoDB

Latest version **1.0.5** (published 2023-10-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install update-mongo-db
pnpm add update-mongo-db
yarn add update-mongo-db
bun add update-mongo-db
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-10-02 |
| First published | 2023-10-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 13.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | inonsh01 |

## Links

- npm: https://www.npmjs.com/package/update-mongo-db
- npm.io page: https://npm.io/package/update-mongo-db

## Dependencies (3)

- [node](https://npm.io/package/node.md) ^18.14.0
- [mongodb](https://npm.io/package/mongodb.md) ^4.16.0
- [prompt-sync](https://npm.io/package/prompt-sync.md) ^4.2.0

## Recent versions

- 1.0.5 (latest) — 2023-10-02
- 1.0.4 — 2023-10-02
- 1.0.3 — 2023-10-02
- 1.0.2 — 2023-10-02
- 1.0.1 — 2023-10-02
- 1.0.0 — 2023-10-02

## README

# My update mongoDB npm Package

## Overview

`update-mongo-db` is an npm package for updating field names and types in MongoDB collections.

## Features

- **Flexible Field Editing**: You can easily edit field names and types in your MongoDB documents.
- **Data Types Supported**: Update field types to boolean, string, date, and objectId.
- **Deep Nesting**: The program handles updates within arrays, objects, and other nested structures.

## Installation

To install `update-mongo-db`, run the following command:
```bash
npm install update-mongo-db 
```

## Usage
    npm run updateDB <update type> <path to field> <update value>

## Example
before:
    {
       someObject:{
           someArray:[{
               fieldName: "true",
           }...]
       }
    }

    // to change from string to boolean
    npm run updateDB type collectionName.someObject.someArray.fieldName bool

    // to change name of field
    npm run updateDB name collectionName.someObject.someArray.fieldName newName

after:
    {
       someObject:{
           someArray:[{
                newName: true
           }...]
       }
    }

---
_Source: https://npm.io/package/update-mongo-db · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
