Socket
Socket
Sign inDemoInstall

mongo-seeding-cli

Package Overview
Dependencies
43
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mongo-seeding-cli

The ultimate solution for populating your MongoDB database. Define the data in JSON or JavaScript. Import collections and documents!


Version published
Weekly downloads
993
decreased by-6.32%
Maintainers
1
Install size
3.91 MB
Created
Weekly downloads
 

Readme

Source

Mongo Seeding

Mongo Seeding CLI

npm version David David Codacy Badge

The ultimate solution for populating your MongoDB database. Define the data in JSON or JavaScript. Import collections and documents using command line interface!

Installation

To install the app, run the following command:

npm install -g mongo-seeding-cli

Usage

Before you begin, follow the tutorial to define documents and collections to import. See samples directory for examples.

In order to seed your database with data from current directory using default configuration, run the following command:

seed

You can specify custom settings with parameters. The following example imports data from ./example/data directory using MongoDB connection URI mongodb://127.0.0.1:27017/mydb.

seed -u 'mongodb://127.0.0.1:27017/mydb' -d ./example/data

Full configuration options are described in Command line parameters section.

Command line parameters

You can use the following parameters while using seed binary:

NameDefault ValueDescription
--data $PATH or -d $PATHcurrent directoryPath to directory containing import data
--db-uri $URI or -u $URIundefinedIf defined, the URI will be used for establishing connection to database, ignoring values defined via other db-* parameters (e.g. db-name, db-host, etc.)
--db-protocol $DB_PROTOCOLmongodbMongoDB database protocol
--db-host $DB_HOST127.0.0.1MongoDB database host
--db-port $DB_PORT27017MongoDB database port
--db-name $DB_NAMEdatabaseName of the database
--db-username $DB_USERNAMEdatabaseUsername for connecting with database that requires authentication
--db-password $DB_PASSWORDdatabasePassword for connecting with database that requires authentication
--drop-databasefalseDropping database before data import
--replace-idfalseReplacing id property with _id for every document during data import
--reconnect-timeout10 (seconds)Maximum time of waiting for successful MongoDB connection
--help or -hn/aHelp

Keywords

FAQs

Last updated on 26 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc