0

I have a Python script that generates a huge JSON. When I put the program to run, it generates a file in Notepad with JSON. I wanted to put this JSON in MongoDB database and let stored, and then be able to search this JSON using MongoDB commands to search for espercificas things. But could not find anywhere how can I get this JSON file in the Notepad, and put in the database. If anyone can help.

tanks

2

1 Answer 1

2

Go to file directory using cmd, outside mongoshell. Then,

mongoimport --db dbName --collection collectionName <fileName.json

Example,

mongoimport --db foo --collection myCollections < /Users/file.json
connected to: *.*.*.*
Sat Mar  2 15:01:08 imported 11 objects
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.