Unable to find .mongorc.js file under home directory - mongodb

The documentation says this file is here
/etc/mongorc.js
Some other resources say that this file is under home directory.
I was not able to find this file in both places. Please help!
Note that my OS is Ubuntu 14.04

Files beginning with . are hidden files. If you are viewing nautilus, in home folder:
ctrl+h
will show you the hiddenfiles.
If you are viewing in command line, try in home folder
ls -a | less
or
ls .mon*
If there is no file, you can create it in the home folder and start using it with the name .mongorc.js in the home folder.

Related

How to access mongoshell from the hyperterminal?

How to link/access mongosh.exe file (which is installed from mongoDB downloads) with hyperterminal command line
Make the directory “”home”” in Hyper Terminal.
cd ~
Check if you see the .bash_profile. If it isn’t there, create one with the command touch. That’s the same as using the Windows command prompt and the command new file.
touch .bash_profile
The vim editor is what you’ll use to open the .bash_profile.
vim .bash_profile
Go to the C:\Program Files and locate the \MongoDB\Server directory. You should see the recently installed MongoDB version identified by its version number.
Right-click the folder to see the full path. Select “Copy” to copy it.
Go to the .bash_profile again in the Hyper Terminal and right-click and select “Paste” or do a CTRL+P to paste the MongoDB installation’s entire path in an instance of the .bash_profile.
alias mongod=""/c/Program\ files/MongoDB/Server/4.0/bin/mongod.exe""
alias mongo=""/c/Program\ Files/MongoDB/Server/4.0/bin/mongo.exe""
Here is the link for setup

How to open an entire folder through CMD to VSCode?

I want to open my entire folder through CMD but I can't seem to find a efficient solution for it.
Let's say my folder's name is source:
$ cd source
$ code index.html
$ code style.css
$ code script.js
I don't want to open each one of the files as I did in the above, because I have many files in this folder.
Thanks
From inside the project directory you can use code .

How to create .kube directory inside the Home directory on Mac?

We usually add the Kubernetes configuration file inside the .kube directory in our Home directory when we use either Windows or Linux operating systems.
But when I try to create a .kube directory on Mac OS, it says,
You can't use a name that begins with the dot because these names are
reserved for the system. Please choose another name.
How can I do this to put the k8s configuration file into it?
I created the .kube directory using the terminal app on Mac and also noticed that the .kube directory can be created at any location on your Mac.
Even though you created it, it will not display in Finder. You have to open the Terminal and check its' availability using ls or ls -la commands.

Set Permanent Flutter Path

The steps for modifying this variable permanently for all terminal sessions are machine-specific. Typically you add a line to a file that is executed whenever you open a new window. For example:
Determine the directory where you placed the Flutter SDK. You will need this in Step 3.
Open (or create) $HOME/.bash_profile. The file path and filename might be different on your machine.
Add the following line and change [PATH_TO_FLUTTER_GIT_DIRECTORY] to be the path where you cloned Flutter’s git repo:
$ export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"
Run source $HOME/.bash_profile to refresh the current window.
Verify that the flutter/bin directory is now in your PATH by running:
echo $PATH
In mac, you should add it as follows in ".zshrc":
export PATH="$PATH:/Users/matteo/Documents/flutter/bin"
After you have updated the ".zshrc" file, run this command to ensure changes have been notified to OS
source ~/.zshrc
Reference: https://flutter.dev/docs/get-started/install/macos
A similar concept is for Linux system using bash files
I tried a lot of methods but this one permanent solution worked for me like a charm:
open Terminal in your Mac: type:
sudo nano /echo/paths
Add the code to the file:
/users/yourUserName/flutter/bin
Save the file using Control+X and Press Y and Enter
Hope this helps! :)

bash: mongo: command not found

I installed mongodb on my system, but when I go to bin directory using Git and type mongo, this happens.
What shall I do?
The problem can solve if you add MongoDB path in the system variables:
Go to this path "Control Panel\System and Security\System" on the left you should see some options click on "Advanced system settings" after this click on "Environment Variables" at the System variables should be one option "Path" click that option and "Edit" it, add "New" variable on this system, in my case, is "C:\Program Files\MongoDB\Server\4.2\bin" and save this change.
if you're using git bash, use the following command
$ ./mongo
I've just had the same problem and did this to solve it. I hope it helps (late, but to be sure it is answered).
Open GitBash and type the following:
1) cd.. // to go to the root directory.
2) touch .bash_profile // creates a hidden file to set up the shortcut
3) notepad .bash_profile // this opens that hidden file with notepad. You can also do it with VIM if you want to master you command console skills...
4) paste these two command lines:
alias mongod="/c/Program\ Files/MongoDB/Server/4.0/bin/mongod.exe"
alias mongo="/c/Program\ Files/MongoDB/Server/4.0/bin/mongo.exe"
!!! Check that your files are also in the same route as these. If not, modify what's needed. Mind the space between "\ Files" because this gave trouble too. You may need to change the version in case you don't have 4.0.
5) Save the file. Close Notepad.
6) At Gitbash again: CRTL + C, and close the console.
7) Open Gitbash again, go to the root, and type: mongo --version. If you see something like: MongoDB Shell version v4.0.10... you've been successful (see image). If not, check the route of the document you've put into the bash profile, and be sure to fully restart the bash console after.
Mongo install success
Hope that helps!
Use mongosh intead of mongo.
This solved my problem using docker
In later versions of this, you have to download mongo shell. Once you downloaded if zip extracts the files and moved folder to your program's folder. Renamed the folder mongosh. Copy the path and added to your environment variables path. it should look like this C:\Program Files\mongosh\bin. Next, if you haven't done so already. Create data folder in your root directory in my case windows c drive. Create a subfolder in the data folder called db. make sure this folder is in the root directory and not in the program's folder. Once this is done, close all the prompt windows and run again mongod and again run now not mongo but mongosh, and it will allow you to type in your code. I had to delete my previous created data folder that i created previous to installation of MongoDB hope this helps.