Install MongoDB Node. js Driver in Ubuntu

Source: Internet
Author: User
Tags install mongodb

I didn't expect MongoDB to have so many choices for Node. js drivers! I thought for a while! It turns out that in addition to the Driver found on the MongDB official website, there are also a lot of good people who have written several MongoDB drivers for Node. js !!

I originally wanted to use the mongoose Driver. Its advantage is that the package has many layers! No! Mongoose is a relatively high level. The famous advantage of mongoose is that it can be used in a similar way to SQL Schema to create a MongoDb database, and the writing method is relatively simple. However, I did not touch MongoDB for the first time, I am a bit familiar with MongoDB and can operate it on my own. Then, I really do not like to define such a column. Therefore, I finally decided to use the node-mongoDb-native Driver with the simplest function. However, after a while, I will know if it is the same as I thought!

The method for installing node-mongoDb-native Driver is very simple. You only need to use npm to install it. Therefore, you can use the following line to install it. If you have not installed npm, install sudo apt-get install npm first!

Npm install mongodb

If you use the above command to install the C ++ command, you must use the following command to execute it, the result is still useless, just use the following command.

Npm install mongodb -- mongodb: native

After the installation, you can start to use it. However, please note that the free version of MongoDB does not provide the Embedded Database function. Therefore, before connecting to MongoDB, start MongoDB first (SEE ).

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.