Mongoimport : The term 'mongoimport' is not recognized

#1

I’m trying to import a json file with mySQL data into my mongoDB but I get this error

mongoimport -h localhost:3030 --db meteor --collection brugere --type json --file /brugere.json


mongoimport : The term 'mongoimport' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ mongoimport -h localhost:3030 --db meteor --collection brugere --type ...
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (mongoimport:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
#2

Have you installed MongoDB?

Is the path in your $env:PATH?

Note that MongoDB do not recommend mongoimport:

WARNING

Avoid using mongoimport and mongoexport for full instance production backups. They do not reliably preserve all rich BSON data types, because JSON can only represent a subset of the types supported by BSON. Use mongodump and mongorestore as described in MongoDB Backup Methods for this kind of functionality.

#3

What is the best way to export my old mySQL datase and import it into my new mongodb?

#4

I don’t think there’s anything stopping you using mongoimport as long as you’re aware of its shortcomings.