I got databse with name "test" in mongoatlas.
I installed mongodb with
mongodb-windows-x86_64-4.4.1-signed.msi
I run this command and it does not shows my test db. I'm trying to make backup my db
show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
I watched tutorial to how to backup&restore in mongodb. So I run the command
mongodump
It says
'mongodump' is not recognized as an internal or external command,
operable program or batch file.
but I can run mongo and mongod command. I gave a path to run mongodb in cmd to environment variables
Also they say in the docs use mongodump command in cmd. I tryed it with administrator mode and it still gives same think.
So how can I backup& restore dbs. Thank you
mongodump is part of the mongo database tools, these tools are not automatically installed when your install certain Mongo server bundles.
As in your case, your cmd line does not recognise this command because it was never installed on your machine.
Follow the instructions here in order to install it.
Access the MongoDB Download Center
Select your Platform from the dropdown menu, then select the following Package for your platform:
Once downloaded, unpack the archive and copy the tools to a location on your hard drive.
You will have to set the MongoDB install path in your Path environment variables
For eg :
My mongoDB is installed at C:\Program Files\MongoDB\Server\4.0\bin
In environment variables i should have,
Also make sure you have installed mongodb properly. You should have following set of exe/files
Related
mongo is not recognized as an internal or external commandmongodb is not recognized as an internal or external commandI'm encountering these errors after having installed mongodb using a tutorial and after having tried the edit environment variables fix.I've edited the environment variables The mongosh keyword is recognized when I type it in in the command line but mongo and mongodb aren't. Mongod results in something I'm not certain it should be resulting in.is this expected? I noticed that the number of files available in my bin folder which is where mongodb is installed is less than that of others that I've seen.this is my bin folder with less files I also noticed that after installing mongodb, the mongo compass didn't auto install. I did that manually. How can I overcome these errors and start using mongodb?
mongod is the binary that runs the database. It has many flags, documented here. The output you see is expected. You will often run this in the background via --fork and send the output to a logfile.
mongo is the legacy shell that is deprecated as of 6.0 and no longer ships.
mongosh is the new shell that should provide all the same functionality as the legacy shell.
mongodb there is no binary with this name.
If you are trying to connect to MongoDB Atlas or an existing database, you should not need to run mongod yourself.
I am trying to dump a database from mongodb where i am getting not recognized error on running the command from command line as admin.
mongodump --db ninjago,
I have added the path variable in environment variables for mongodb. I am still getting the error.
Please help. thanks
You have to additionally install MongoDB Database Tools in order to use mongodump in the CLI. If you need to restore the data, after installing MongoDB Database Tools you will be able to use the mongorestore in the CLI as well.
You can download the MongoDB Database Tools on official MongoDB download page, and then you can follow the official installation guide.
I am a starter of MongoDB. According to the "Import Example" section of MongoDB 3.2 Manual, the prerequisite for importing data into the database is to have a running mongod instance. With limited background knowledge of MongoDB, I failed to fully understand this line of instruction. Could anyone please give me some explanation on how to run a mongod instance step by step in Mac Terminal? Thanks.
Here are several steps to do start mongodb var mongod
created the ./bin/data/db directory storing mongodb data file.
Start one terminal for mongodb server
Go to mongo/bin, and execute this command
./mongod
Start another terminal for mongodb shell
Go to mongo/bin, and run
./mongo
Now we can connect to mongodb now, more command like show dbs, show collections, use dbname, For more commands in mongodb, refer to db.help()...
I have implemented a javascript script for my mongo database. This script is called getMetrics.js and I am able to execute it by running: mongo getMetrics.js from my computer.
Now I want to automatically execute that script one time per day. To do so, I have created a Heroku app and I added to it the scheduler add-on (https://devcenter.heroku.com/articles/scheduler).
My main problem is that in order to be run, my task will execute the command "mongo getMetrics.js" and it will failed because I don't have mongo command installed in my Heroku app.
How can I run this script from Heroku?
Thanks a lot for your help.
I did the below in a similar case:
Download mongodb for linux https://www.mongodb.com/download-center#community
The bin folder contains the mongo binary
Make this binary available in your Heroku instance (e.g. If you have your Heroku configured with your git repo, then checkin this binary along side your script
[Make sure the folder you are keeping this binary is in the path, safe path will be inside /bin]
situation
Hello, I run arch Linux for which there is no meteor package and have an Ubuntu server run within virtualbox for web development. There is a shared folder I mount through database. hich means I can code in to the active environment.
However, like many others, I have a problem with mongodb starting up, specifically the exit code 100.
tracing the problem:
I created the /data/DB directory
gave access rights to my user
ran mongod on its own with no problems
Still I have the issue though.
Question
Where is the configuration file for mongodb which is installed with meteor so I can move it and do I need to create rights for a 'mongodb' user?
Question
What would be the ideal virtual machine for running a meteor development environment in the above set up? Having to create the data directory in the first place tells me Ubuntu server isn't ideal. some extra documentation available to answer this second question appearing on the meteor website would be beautiful
MongoDB does not work correctly on virtualbox shared folders. By default, meteor creates a mongo database in your project's directory, however you can override this behavior with the MONGO_URL environment variable. If you set this variable, meteor will not try to start mongo and will instead connect directly to the mongo endpoint you specify. This allows you to setup mongo however you like (eg using the Ubuntu mongodb package), with data somewhere not in the shared folder.