The concise use of MongoDB

Source: Internet
Author: User

①, CharacteristicsDocument database High performance high availability cluster document is a Bson object A collection is a set of related documents that share the same indexs②, how to useMONGO;//Enter MongoDB JavaScript interactionShow DBS; See which DBUse mydb; Switch to MyDBDB; //Current DB Show Collections; //See what collection var c = db.users.find (); //return cursor ③, Curdcall mode is Db.collection.action Enquiry:The parameter for find () is JSON, and the operator is converted to the corresponding object representation, such as <18 {$gt: 18} Indicates that the operation words commonly used in a query are: $or $gt $lt $elemMatch $in $exists can use attribute symbols. Parses the performance of a query statement by referencing child elements or sub-attributes. Explain () Insert:Method One: The operation words commonly used in analogy Sql:insert are: $set $inc method Two: Specify the Save statement for _id
1 Db.inventory.save ({2     _id:10,3     Type: "Misc",4     Item: "Placard"5 })    

Delete: Analogy sql: ④, transaction processingDoes not provide API-level transaction processing, only through the business code level, in the document to add status, transaction and other fields to simulate transaction processing ⑤, Important API InterpretationUpdate () passes three parameters, first query condition, second action on field, third action Flagfind () pass in one or two parameters, first query condition, second filter which field, query condition supports regular
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.