Category:MongoDB

  • Simple installation and basic operation of mongodb in Linux system

    Time:2020-2-23

    Mongo DB is a very popular non relational database (NoSQL) in the IT industry. Its flexible data storage mode is favored by the current IT practitioners. Mongo DB implements the OO idea very well. Every record in Mongo DB is a document object. The biggest advantage of Mongo DB is that all data persistence operations […]

  • Introduction to mongodb tutorial index

    Time:2020-2-21

    1、 Index basis: The index of MongoDB as like as two peas, which are almost the same as traditional relational databases, includes some basic optimization techniques. Here is the command to create an index:   Copy codeThe code is as follows:     > db.test.ensureIndex({“username”:1})   You can check whether the index has been successfully established […]

  • Introduction to mongodb tutorial

    Time:2020-2-20

    1、 Notes for documentation: 1. Key value pairs are ordered, for example: {“name”: “Stephen”, “Genda”: “male”} is not equal to {“Genda”: “male”, “name”: “Stephen”}2. Document information is case sensitive, for example: {“name”: “Stephen”} is not equal to {“name”: “Stephen”}3. Document information is type sensitive, for example: {“age”: 30} is not equal to {“age”: “30”}4. duplicate […]

  • Aggregation of mongodb tutorials (count, distinct, and group)

    Time:2020-2-19

    1. count: Copy codeThe code is as follows: — in an empty collection, count returns 0.     > db.test.count()     0— test the return value of count after inserting a document.     > db.test.insert({“test”:1})     > db.test.count()     1     > db.test.insert({“test”:2})     > db.test.count()     2— count, like find, accepts conditions. From the results, […]

  • Basic management commands of mongodb tutorial

    Time:2020-2-17

    1. Start and stop mongodb: Execute the mongod command to start the mongodb server. Mongod has many configurable options. We can view all options through mongod — help. Here are just some main options:   Copy codeThe code is as follows:     –dbpath:By default, the data directory of the database is / data / DB. […]

  • Data operation instance of mongodb tutorial

    Time:2020-2-16

    1. Batch insertion: Inserting multiple documents at a time in the form of array can be completed in a single TCP request, avoiding the extra overhead in multiple requests. In terms of data transmission volume, the bulk inserted data contains only one message header, while multiple single inserts encapsulate the message header data each time […]

  • Query operation instance of mongodb tutorial

    Time:2020-2-15

    1. Basic query: Construct query data.   Copy codeThe code is as follows:     > db.test.findOne()     {          “_id” : ObjectId(“4fd58ecbb9ac507e96276f1a”),          “name” : “stephen”,          “age” : 35,          “genda” : “male”,          “email” : “[email protected]”     }  — multi criteria query. The following example is equivalent to where name = “Stephen” and […]

  • Mongodb series tutorial (1): origin of NoSQL

    Time:2020-2-13

    Why does NoSQL appear? With the development of the Internet, when we turn one server into two servers, when we start to establish data backup, when we need to add a buffer layer to adjust all queries and invest more hardware.Finally, we need to segment data into multiple clusters, and reconstruct a large number of […]

  • Mongodb series tutorial (2): introduction to mongodb

    Time:2020-2-12

    Mongodb introduction     Mongodb is a product between relational database and non relational database. It has the most abundant functions and is the most like relational database. The data structure he supports is very loose, which is similar to the bjson format of JSON, so it can store more complex data types. The biggest feature of […]

  • Mongodb series tutorial (3): Download and install mongodb in Windows

    Time:2020-2-11

    Software download Download mongodb‘s latest package: http://www.mongodb.org/downloadsDownload mongodb visualization interface, mongovue: http://download.csdn.net/detail/lovesumerforever/8036417   Software installation The installation steps of mongodb server are as follows: 1. Comply with mongodb specification, choose your own disk to create folder, here I choose D disk, and create the following directory structure   Copy codeThe code is as follows: D: […]

  • Mongodb series tutorial (4): setting user access rights

    Time:2020-2-10

    We know that when MySQL is installed, we need to set a database default user name and password, and mongodb is no exception. However, mongodb does not have access restrictions by default. You do not need to enter a user name and password to access it, but it will be very insecure. We need to […]

  • Mongodb series (5): comparative study of Mongo syntax and MySQL syntax

    Time:2020-2-9

    We always see our own advantages and disadvantages in comparison. For mongodb, the same is true. Comparative learning enables us to master the basic knowledge of mongodb as soon as possible. Comparison between mongodb and MySQL commands Relational database is generally composed of database, table and record. Mongodb, a non relational database, is composed of […]