NoSql journey-mongoDB shell command summary, nosql-mongodb

Source: Internet
Author: User

NoSql journey-mongoDB shell command summary, nosql-mongodb
MongoDB three elements. Database, set, and document.


A set is equivalent to a table in a relational database, and a document is equivalent to a row in a table.




Document is json extension (Bson form)


MongoDB basic addition, deletion, modification, and query
Insert
Db. tablename. insert ({Bson format });


Find
Db. tablename. find () query all


Db. tablename. find ({Bson format}) query by keyword


Update
Db. tablename. update ({},{}) the first parameter is the query condition, and the second parameter is the updated value.


Remove
Db. person. remove () delete all records, which cannot be undone.
Db. person. remove ({}) is deleted based on conditions.
Db. person. count () Total number of records.

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.