

- #Load mongorc js robo 3t .mongorc.js .exe#
- #Load mongorc js robo 3t .mongorc.js update#
- #Load mongorc js robo 3t .mongorc.js code#
- #Load mongorc js robo 3t .mongorc.js download#
#Load mongorc js robo 3t .mongorc.js update#
Update Operations can be used to update data, It takes two parameters, The first parameter represents the update condition, The second parameter represents the data to be updated, For example, I will all x:1 Change the data to x:999, as follows : The data found out is in addition to the data we inserted x outside, One more _id Field, This is the field that the system automatically adds for us, We can also introduce ourselves _id, however _id Field cannot be duplicate, as follows :įind and findOne Query parameters can also be passed in, We'll talk more about this later. Separately find and findOne Method view, as follows : checkĪfter the data is added successfully, let's take a look at the query again, utilize db.sang.find() Method we can view all documents ( All records ), If you only view one document ( A record ), Can pass db.sang.findOne() command, Before I look at it, I'll use a for Insert more data in the loop, as follows : Of course, we can also add documents in batches, as follows ( Batch addition can also be used insert Method to accomplish ):ĭb.sang_collect.insertMany()ĭue to the of the second document _id The field is the same as the previous one, So the second and third document insertion failed, The first document is inserted successfully. Stay MongoDB in, Every record we insert is a json character string, This json String we call file , Multiple documents can form one aggregate , This document is similar to a row of data in our relational database, A set is similar to a table in a relational database, Collections don't have to be created specifically, You can directly enter which set to insert data into, The collection will be created automatically. But an empty database system will not be displayed, Insert a record into the database, We can see that the database exists, as follows : In the above ), as follows :īefore adding, let's talk about the creation of database, We mentioned above use command, Indicates switching to a database, If we want to switch to a database that doesn't exist, The system will automatically help us create this database. Here ,shell Will be connected to MongoDB Server's test database, And assign the database connection to the global variable db, We will pass db This variable performs many functions, We can also check db Which database is currently pointing to, Use it directly db command, as follows :Īnother example is that we can pass use Command to switch the database ( I've also used. If we don't use Robo 3T Tools, But directly on the command line mongo Command to start shell, as follows : We can also call JavaScript Standard function library, as follows :Īnother example is calling Date function, as follows :
#Load mongorc js robo 3t .mongorc.js code#
:Īfter the code of function definition and call is written, Press the triangle symbol in the upper left corner to indicate the operation, You can also press F5 perhaps Ctrl+Enter Composite key. There shell Is a fully functional JavaScript Interpreter, Can run JavaScript Program, This is fun, I define a function and call it.


#Load mongorc js robo 3t .mongorc.js .exe#
exe Double click the executable to start, Create a new connection after startup, Input ip Address ( Be sure to make sure before connecting Linux Upper MongoDB Has been launched ), as follows :Īfter successful connection, We can see the information of the database, as follows :įor the time being, all our operations are put in test In the database ( By default ,test The database is empty, Empty databases are not displayed here, At this point, you can select CentOS menu, Right click and click Open Shell, The default test database ), Choose test, Right click, choice Open Shell, as follows :
#Load mongorc js robo 3t .mongorc.js download#
Of course, We can also connect through some client tools MongoDB, such as Robo 3T.įirst we download Robo 3T( Download address ), After the download is successful, unzip, find. In the last article, we mentioned that we can MongoDB After successful startup, pass mongo Order to enter MongoDB client, Then input the operation command on the client to perform operations such as addition, deletion, modification and query. This article is about MongoDB The second article in the series, Understanding the previous article will help you better understand this article : In the last article, we briefly introduced MongoDB Installation and startup commands, In this article, let's take a look at the basic addition, deletion, modification and query, Yes MongoDB Let me give you an intuition.
