MongoDB Common Commands

Source: Internet
Author: User

Show DBS View all databases
Show Tables View all collections
db Displays the current database
use+name switches to the specified database and creates a new if it does not exist
A document is a set of key-value (Key-value) pairs (that is, Bson). MongoDB documents do not need to set the same fields, and the same fields do not require the same data type
{"Name": 2, "Age": 169}
{"Name": "Óin", "Age": 167}
{"Bianhao": +, "age": 82}
Create a fixed-size collection db.createcollection ("Mycoll", {capped:true, size:100000})
Db.runoob.insert ({"Name": "Rookie Tutorial"}) inserting data into the database
db.dropdatabase () Delete the current database
db.collectionname.drop () Delete collection

MongoDB Common Commands

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.