MongoDB Getting Started tutorial two [introduction and use of MongoDB Shell]

Source: Internet
Author: User

MongoDB Shell is a JavaScript shell that comes with MongoDB, which is released with MongoDB, which is a MONODB client tool that allows you to interact with the MongoDB instance using commands in the shell, and manage operations on the database (curd, Cluster configuration, Status View, etc.) can be done through the MongoDB shell.

Here are some basic commands and tips for MongoDB today:

1. Use Help to view assistance:

Enter: "Db.user.find (). Help ();" See Help for Find ()

2. Basic commands:

    • Connect/switch Databases For example: use neighbor;
    • Data insertions such as: Db.user.insert (obj);
    • Data Query Example: Db.user.find (query);
    • Data updates such as: Db.user.update (query,obj);
    • Data deletion For example: db.user.remove (query);

3. You can write MongoDB execution commands to a separate JS file, then execute them with the following methods, and you can also interact with the MongoDB database:

Direct execution, such as:

    • MONGO [--quiet] script.js

Interactive execution, such as:

    • Load ("Script.js")

4. For more commands, refer to the official documentation:

http://docs.mongodb.org/manual/reference/mongo-shell/

MongoDB Getting Started tutorial two [introduction and use of MongoDB Shell]

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.