My MongoDB Bumpy Road

Source: Internet
Author: User

      • Summary
      • Environment construction
        • Prelude
        • Post-recruit
        • Configuration
          • Configuring Environment variables
          • Configure the data path
          • View information
      • Initial use
        • Landing
        • displaying database information
        • Select Database
        • displaying table Document Information
        • Change and delete
      • Client
        • Download installation
        • The road to crack
      • Summarize

Summary

It's a relational database that has been most exposed to all the time, and it's really not very familiar to NoSQL. But for the current development, NoSQL is a relatively fire direction, and in many NoSQL databases, MongoDB is so "beautiful", so that people can not help but charmed. But unexpectedly, in the process, but it is so bumpy. So he made this article to remember.

A prelude to environmental construction

As usual on the official website https://www.mongodb.com/directly find the download button, download a windows.msi version of the good.

The official latest version of MONGODB requires:
vc++2015 RC x64 Support, otherwise it will be reported

But unfortunately, my computer version is not enough. What's the situation?
And then look at the following document, Windows7 words need the minimum version of 7601, and my version is 7600. (⊙o⊙) Ah! It's really good.

The installation will pop up a window that reads:

Lost Api-ms-win-crt-runtime-|1-1-0.dll

Now that you know where the problem comes from, that goal is very clear, and then find AH on the Internet, the answer is quite a lot, but basically not reliable. I couldn't have succeeded anyway.

Finally upgrade windows, add a patch pack it, but the speed is not to force, under a long time, eventually nothing.

Post-recruit

Since the latest download is not, then back to the second, download the earlier version of the bar. Anyway is the study use, also cannot use how complex function, should be enough.

What I'm trying on here is 2.0.6 version, the pro-test is easy to use. For more people to learn to use, you can download it at the link below. (Do not point: http://download.csdn.net/detail/marksinoberg/9703363)

Unzip to a folder after downloading.

I am also fluke, did not expect this version of the really can use

Configuration

As shown in the second step, unzip to a folder when you are finished downloading. Then create a new folder to hold the database data (this folder is arbitrarily placed, but for easy management, it is better to put together).

Configuring Environment variables

In order for the command line to find some of the built-in commands for MongoDB, we need to configure the bin directory to the environment variables of our own computer.

Computer – System Properties – Advanced system settings – environment variable –path

Configure the data path

To facilitate MongoDB to find the data location, we need a little configuration. Used to temporarily open the MongoDB database service. If you are interested, you can also turn it into a system service, which makes it easier to use. There is not much to be described here.

Mongod–dbpath "Data folder path"

The information that appears indicates that the database path configuration was successful.

View information

To get a clearer view of the MongoDB veil, you can use your browser to see the details.

MONGO 127.0.0.1:27017/admin

Follow the prompts below to try

MONGO 127.0.0.1:28017/admin

Initial use

For MongoDB, the way to start with the shell is to lay a firmer foundation for the future. Most of the following will be done by comparing MySQL with relational databases to further deepen the learning comprehension and use of nosql.

Landing

Analogue relational database MySQL terminal login:

Mysql-u root-p Password

MongoDB is also similar to the following:

MONGO 127.0.0.1:27017admin

appear, indicating that you have successfully landed. (The default is no password).

displaying database information

Compare MySQL to view the database information that is in the system.

show databases;
MongoDB is similar, except that the command name is different.
Show DBS;

Such as:

Select Database

In MySQL, to use a specified database, you can use:

Use DatabaseName;

In MongoDB, the same is true:

Use Foobar

Such as:

Show Table/Document Information

In a relational database, you can see which tables are in a database and use:

Show tables;

In the non-relational database of MongoDB, the principle is actually similar. But conceptually there's a slight discrepancy. For example, NoSQL is called the Table document (collection). The commands for displaying MongoDB Chinese files are:

Show collections;
Such as:

Change and delete

Unlike MySQL, a relational database, the additions and deletions of NOSQL commands have specific usage patterns. And they're all based on "conditions," which is nothing to do with SQL statements.

    • Find ()
    • Remove ()
    • Update ()
    • Insert ()

As for the detail section, this is a little bit more detailed in the next blog post.

Client

Familiar with the shell mode Operation MongoDB, also on the command of writing more familiar with. At this point, we can use the client tools to help us improve our efficiency. Find an article on the Internet for MongoDB clients.
http://blog.csdn.net/chszs/article/details/51348248

What I'm going to say here is a more usable client tool. Mongovue. And here is the main explanation of how to hack this tool, so that later pop-up window annoying.

Download the installation Hack road

First win+r the cmd command line, enter Regedit. Find the field shown below and delete the right-hand-over. (because the blogger has already cracked, so borrow a Bo friend's crack chart).

This will allow you to use this artifact for free.

Summarize

This article is roughly about some of the foundational things about the NoSQL leader, MongoDB. There is no skill, just an environment. Solve some of the strange problems that you have encountered.

My MongoDB Bumpy Road

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.