Constructing documents in MongoDB – Part 8

Leave a comment

The whole purpose of setting up a Mongo database is so that you can store documents, so a really, really critical operation is to create and insert those documents. Fortunately, that all occurs in one single step. One single command both creates the document and inserts it.Now the first thing we’d like to know is what are the current documents in this particular database? db.products.find() is the most basic find() command, and you’ll notice we have eleven products listed in this particular

Learn More

MongoDB data storage – Part 7

Leave a comment

Every MongoDB instance consists of three things Namespace file Journal file Data file. And it could consist of multiple data files, multiple journal files and multiple namespaces even. Now, we’re interested in understanding the database storage, so we would like to know more about these data files, more about what constitutes a MongoDB. Fortunately, there are some commands that will do that for us, let’s take a look at a few of those.First of all, I just want to know the size of the data files,

Learn More

Describing CRUD – Part 6

Leave a comment

There are four operations we need to talk about. All databases, whether they be traditional relational database systems, or NoSQL, they all require what are called CRUD operations. CRUD is an acronym that stands for Create, Read, Update and Delete. These operations are the fundamentals for all interactions within a database.MongoDB queries are very flexible in providing these operations. First of all, they give you the option of targeting a specific collection of documents, within the database.

Learn More

The Mongo Shell – Part 5

Leave a comment

Rest of the document is written assuming that MongoDB is already installed in the system. If not, please go to the link given https://docs.mongodb.org/manual/installation/ for reference. The terminal commands will be differ for operating systems, but mongo shell commands are same.Open command prompt and enter mongod to start the mongo server.On successful installation, it will show port number 27017 below.Keep current command prompt open, and open another command prompt. Enter mongo on new

Learn More

Connecting to MongoDB – Part 4

Leave a comment

How to connect to MongoDB using the Shell or Command Prompt.So, there is really two possibilities here. You’re working from a Linux-type shell. And by the way even Macintosh uses a bash shell or you’re using a Windows Command Prompt. The only differences are this. If you’re using the Windows Command Prompt, make sure you are running the Command Prompt as administrator. If you’re using a Linux Shell, make sure you proceed your initial commands, your actual Linux commands with the keyword sudo, so

Learn More

Tags