In the previous article, the hacker has already moved on to mongodb's installation on the Windows platform, and double-click monge.exe to start data operations on the database. Insert record: [insert] Next we will create the j and t objects and save them to the test set. Insert a record (id 3 and name Max): query records
The previous blog has installed and configured mongoDB on windows. Next, double-click monge.exe to start data operations on the database. Insert record: [insert] Next we will create the j and t objects and save them to the test set. Insert a record (id 3 and name Max): query records
Zookeeper
In the previous article, the hacker has already moved on to mongodb's installation on the Windows platform, and double-click monge.exe to start data operations on the database.
Insert record: [insert]
Next we will create the j and t objects and save them to the test set.
Insert a record (id 3 and name Max ):
Query record: [find]
1. Common query:
2. Conditional query:
3. findOne ()
4. Use limit to limit the number of query result sets
Modify record: [update]
Delete record: [remove]
Create a stored procedure:
MongoDB also supports stored procedures like relational databases. The difference is that it is written in javascript and stored in the db. system. js document.
1. Create a stored procedure for addition calculation:
2. Input a parameter call to create a stored procedure:
Summary:
In addition to the data operation methods verified by the author, there are many common operations such as sort sorting, count query records, and logical operations in MongoDB.
From a series of operations above, we can see that mongoDB is unique in that it is separated from complicated SQL statements and treats each record as an object for operation. addition, deletion, modification, and query are performed by calling insert (), remove (), update (), find. This makes it easy for us to understand and use object-oriented ideas. Of course, it also has other advantages, such as the document structure to store data, improve read and write efficiency, and ensure user access speed. SoThe more you learn, the stronger you are ~~ Stayhungry, stay foolish.