Mongodump mac vs ubuntu
NickName:Pradeep Vairamani Ask DateTime:2022-04-08T08:12:43

Mongodump mac vs ubuntu

I am trying to get a dump of a specific collection from my database. In mac, I am running the following command:

/usr/local/bin/mongodump --uri <connection_string> --db admin --collection tenants and it works perfectly well.

However, when I try to run the same command in ubuntu, I get the following error: error parsing command line options: illegal argument combination: cannot specify --db and --uri

I tried to add the /dbname suffix to the connection string but then I am not able to download a single collection as it fails with the error Failed: bad option: cannot dump a collection without a specified database

Replacing --uri with --host seems like another possible solution but that does not work for me since I only have the connection string and do not have access to the username and password.

Another weird thing I noticed is that in mac, the command mongodump --version returns:

MongoDB shell version v5.0.6
Build Info: {
    "version": "5.0.6",
    "gitVersion": "212a8dbb47f07427dae194a9c75baec1d81d9259",
    "modules": [],
    "allocator": "system",
    "environment": {
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}

However, in ubuntu I am seeing mongodump version: built-without-version-string.

How do I get a dump of a single collection using connection string on Ubuntu?

Copyright Notice:Content Author:「Pradeep Vairamani」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/71790291/mongodump-mac-vs-ubuntu

More about “Mongodump mac vs ubuntu” related questions

Mongodump mac vs ubuntu

I am trying to get a dump of a specific collection from my database. In mac, I am running the following command: /usr/local/bin/mongodump --uri &lt;connection_string&gt; --db admin --collection ten...

Show Detail

PySpark results different in Ubuntu vs Mac

I am using DataFrame in pyspark.sql. Why is the output different in Ubuntu vs Mac? I am using only 10 documents, so N=10. The formula I used is tf-idf = (1+log(tf))*log(N/df). So you can see actua...

Show Detail

mongodump archive vs gzip

When using mongodump there's two options listed in the docs regarding compression: gzip and archive. What's the difference between the two? Can / Do I want to use them in conjunction or are they mu...

Show Detail

mongodump and mongorestore on PythonAnywhere

I am using PythonAnywhere to host my web application. Using Mongodb as my database. Now my task is to take backup periodically and restore specific version of mongodb whenever I want. To do it on ...

Show Detail

MongoDB 3.0.1 mongodump error

I need to create a dumpfile of a MongoDB db using 'mongodump'. ubuntu-0864947@ubuntu-vm:~$ mongo MongoDB shell version: 3.0.1 connecting to: test Server has startup warnings: ...

Show Detail

mongodump not recognizing --uri

I am not sure if I don't have the latest mongo or mongodump but I get cannot recognize &quot;uri&quot; when I run the following in the terminal on my MAC. mongodump --uri mongodb+srv://blah:mypword@

Show Detail

Using mongodump: "mongodump: command not found"

I'm trying to get a dump of my local database and it seems I should be using: mongodump --host localhost:3002 However, the terminal then tells me: -bash: mongodump: command not found Am I mis...

Show Detail

How to Make VS Code Terminal Run Ubuntu Mac?

Hello I'm using a mac and how do I setup the terminal that comes with vs-code to use Ubuntu? (basically same commands that are used in the mac terminal) I'm new guys so please go easy on me.

Show Detail

Mongodump getting blank folders

I am trying to run this command from a remote ssh mongodump --host mongodb1.example.net --port 27017 --username user --password pass --out /opt/backup/mongodump-2013-10-24 However, all I am getti...

Show Detail

Decoding mongodump's stderr

I'm trying to mongodump my DB from my Node.js code: var args = ['--db', 'DBName', '--out', backupDirectory]; var mongodump = spawn('/usr/local/bin/mongodump', args); mongod

Show Detail