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:
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]