UNPKG

hera-mongo-tools

Version:
91 lines (75 loc) • 2.05 kB
<h1 align="center">Welcome to hera-mongo-tools šŸ‘‹</h1> <p> <a href="https://www.npmjs.com/package/hera-mongo-tools" target="_blank"> <img alt="Version" src="https://img.shields.io/npm/v/hera-mongo-tools.svg"> </a> <a href="#" target="_blank"> <img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" /> </a> <a href="https://twitter.com/brokolililer" target="_blank"> <img alt="Twitter: brokolililer" src="https://img.shields.io/twitter/follow/brokolililer.svg?style=social" /> </a> </p> > 4HERA Node packages ### šŸ  [Homepage](hera-mongo-tools) ### ✨ [Demo](https://control-path.4hera.com) ## Install ```sh npm install hera-mongo-tools ``` ## mongodump ```sh const HeraMongoTools = require("hera-mongo-tools"); var commandArray = [ '--uri=mongodb://127.0.0.1:27017/myDB', '--gzip', '-o', '/dump' ]; var options ={ command: commandArray,showCommand: false }; var hmt = new HeraMongoTools(options); hmt.mongodump(function(callback) { //... }); ``` ## mongorestore ```sh const HeraMongoTools = require("hera-mongo-tools"); var commandArray = [ '--uri=mongodb://127.0.0.1:27017/myDB', '--nsInclude="*"', '--drop', '--gzip', '/dump' ]; var options ={ command: commandArray,showCommand: false }; var hmt = new HeraMongoTools(options); hmt.mongorestore(function(callback) { //... }); ``` ## mongoimport ```sh const HeraMongoTools = require("hera-mongo-tools"); var commandArray = [ '--uri=mongodb://127.0.0.1:27017/myDB', '-c', 'mycollection', '--jsonArray', '--drop', '--file', '/dump' ]; var options ={ command: commandArray,showCommand: false }; var hmt = new HeraMongoTools(options); hmt.mongoimport(function(callback) { //... }); ``` ## Author šŸ‘¤ **Burak Simsek** - Website: [burak-simsek.com](https://burak-simsek.com) - Twitter: [@brokolililer](https://twitter.com/brokolililer) - LinkedIn: [@brokolililer](https://linkedin.com/in/brokolililer) ## Show your support Give a ā­ļø if this project helped you!