mongodbmongoexportdatabasenosql

command not found: mongoexport


I use a mongodb database, I am on macOS, the command mongoexport does not pass, I am under the /bin directory of the database

here is my command

mongoexport --db Battleship --collection user --out resultExport.json

my database is Battleship , and the collection is user

any idea \?


Solution

  • If mongoexport is in the same directory that your current one (and also is executable and you got perms to execute it) then you need to prepend executable with ./ and invoke it that way:

    ./mongoexport --db Battleship --collection user --out resultExport.json
    

    Here's more on why you need that for https://askubuntu.com/a/320657/649099