Skip to main content

import file to your mongodb database

Project description

MonogoFileImport Instruction

This is a module to help you import json file into monogodb.

How to install

pip install MongoFileImport

Using in command

There are 9 argument when you use in the command.

argument type default desctipyion
--mongourl str None Your monogoDB url, you need to get the python version connection url, like mongodb+srv://username:password@clusterxxxx.mongodb.net/test?authSource=admin&replicaSet=Cluster0-shard-0&readPreference=primary&appname=MongoDB%20Compass&ssl=true
--file str None your file name
--dir str None your dir name
--db str None your database name
--cn str None your collection name

Example 1: import a folder with json files to your database, the name of collections are the name of the json files.

MongoFileImport --mongourl mongodb+srv://username:password@cluster0-xxxxx.mongodb.net --db test --dir d:/Downloads/Dataset_22_March_2020/Dataset_22_March_2020/revisions

Example 2: import a json files to your database, the name of collection is the name of file

MongoFileImport --mongourl mongodb+srv://username:password@cluster0-xxxxx.mongodb.net --db test --file d:/Downloads/Dataset_22_March_2020/Dataset_22_March_2020/revisions/Australian.json

Example 3: import a folder with json file into one collection, the name will be set in --cn

MongoFileImport --mongourl mongodb+srv://username:password@cluster0-xxxxx.mongodb.net --db test --dir d:/Downloads/Dataset_22_March_2020/Dataset_22_March_2020/revisions/ --cn collectionname

Example 4: import a json file into one collection, the name will be set in --cn

MongoFileImport --mongourl mongodb+srv://username:password@cluster0-xxxxx.mongodb.net --db test --file d:/Downloads/Dataset_22_March_2020/Dataset_22_March_2020/revisions/Australian.json --cn collectionname

if you want to know more, please visit : https://github.com/shanzhengliu/MonogdbFileImport

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MongoFileImport-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file MongoFileImport-0.1.0.tar.gz.

File metadata

  • Download URL: MongoFileImport-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4

File hashes

Hashes for MongoFileImport-0.1.0.tar.gz
Algorithm Hash digest
SHA256 73cac4a7e8864debd63196a39aecc96d62a7611c3b30878a787520ad78baeabd
MD5 8214ed5d09f575dc3489dd25a2cc17ff
BLAKE2b-256 6ab0a3d9fea0744a44a28be069e053086aba7f39db9e2ac193d490d4d50e2472

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page