In MongoDB, users can have privileges across different databases. In the following article i will show how to create, show and delete a user in MongoDB. I will also show how to create a user with admin and a user with root (superuser) privileges on the all databases in MongoDB.
By default, authentication is disabled in MongoDB, but this is not so critical as, out of the box, MongoDB is listening on localhost only. If you are going to allow remote connections to MongoDB, then it is definitely needed to enable authentication. In the following article i will show how to enable authentication in MongoDB […]
In MongoDB, in the opposite to traditional SQL databases, there is no need, as well as possibility, to create an empty database. To create a new database in MongoDB, it needs to insert at least one document into it. In this article i will show how to create a new database and a user for […]
While working with Git, it’s very common to move back and forth between two branches. If you want to checkout the previous branch you was working on, there is no need to type the name of this branch each time. In this short note i’ll show the easy way to switch between two branches in […]
When you are working with multiple branches in Git, it’s important to be able to compare them and contrast the differences. In this short note i will show how to compare two branches in Git using the git diff command. I will show how to git diff between any two branches, e.g. current branch and […]
While working with Git it is often required to check the changes between different areas. Probably everyone knows the git diff, that shows the changes between the Working Directory and the Staging Area (git diff unstaged). But it is also often needed to shows the changes between the Staging Area and the HEAD (git diff […]
Out of the box, MongoDB doesn’t allow remote connections, because by default it has no authentication enabled and is listening on localhost only. If you try to connect to MongoDB without remote access being allowed, you will get this error: Error: couldn’t connect to server $MongoDB:$Port, connection attempt failed:SocketException: Error connecting to $MongoDB:$Port :: caused […]
From the following article you will find out how to connect to remote MongoDB server from the command line using mongo shell. I will also show how to connect to remote MongoDB server with enabled auth. First of you need to install mongo shell, ensure that MongoDB server allows remote access and if authentication is […]
What is MongoDB? MongoDB is an open-source document-oriented database. It is one of the most powerful NoSQL databases and is commonly used in modern web applications. From the following article you will find out how to install the latest (or specific) version of MongoDB on Ubuntu and CentOS.
The MongoDB client, also known as mongo shell, is a command line interface to MongoDB. The mongo shell is included in MongoDB package, but to connect to MongoDB it is enough to install MongoDB client only, without MongoDB itself. From the following article you will find out how to install the latest (or specific) version […]