Ubuntu Installation MONGO Database

Source: Internet
Author: User
Tags install mongodb

Install the MONGO database and enter it under the shell

sudo apt-get install MongoDB

If you need to use the MONGO database in Python , you will also need to install the Python wrapper library

Pip Install Pymongo

To detect if the installation was successful, you can use the following command to start MongoDB locally

Mongod-dbpath.

Enter MONGOin the shell to enter the MONGO database

Querying database statements

> Show DATABASES;CACHE0.0625GBLOCAL0.03125GB

using Database Statements

> Use cache;switched to DB cache

Querying all Table statements

> Show Tables;system.indexeswebpage

Querying for content in Talbe

Db.webpage.find ();

Querying statements for some columns

Db.webpage.find ({},{_id:0})    #0代表不显示, 1 represents the display

Query a statement for a specific row

Db.webpage.find ({ID: "XXX"})

Ubuntu Installation MONGO Database

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.