update-mongo-db
v1.0.5
Published
program for update type or name of field in mongoDB
Downloads
21
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:
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 }...] } }