Some curd operations of MongoDB

Source: Internet
Author: User

Some additions and deletions of MongoDB change the command operation: Official document reference https://docs.mongodb.com/manual/reference/method/

  

#查看当前mongod下有哪些数据库: Show dbs# enters or creates a database: UseDatabase name Use db_name#查看当前数据库下, which collections (tables): Show tables or show collections# create a collection, (insert a document directly) DB. Collection name.Insert({a:1}) #更新文档db. Collection name.Update(Query,Update,option#删除文档db. Collection name. Remove (query, Justone) #查询文档db. Collection name. Find (query, projection) #创建索引db. Collection name. CreateIndex (Keys, Options) #删除当前数据库db. Dropdatabase () #删除表db. Collection name.Drop() #排序sort # Skip and Limitskip limit# common aggregations when queryingCount、Group, aggregate, mapReduce, etc.

  

Create or a database,

Some curd operations of MongoDB

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.