Python operation database cases mysql, redis, mongodb, neo4j

Article directory Preface 1. Installation of python library MySQL Redis MongoDB Neo4j MySQL case pymysql case mysql-connector-python case Redis case Mongodb case Case number one Case 2 Neo4j case Case number one Case 2 Summarize Foreword With the rapid development of data science and big data technology, database management has become an indispensable skill. Python, […]

mongodb operation documentation

Article directory summary topic refer to Summary mongodb operation documentation Version v6.0.11 Title 2. (6) Insert the following order information into the order collection of the test database, output the order information of “zhangsan”, and use pretty() to format the query results for display. { _id:2, name:”zhangsan”, title:”Product Shopping List 5″, amount:60, unit:”yuan”, detail:[ {name:”Apple”,price:22}, […]

How to use docker to create multiple database containers: mysql, redis, mongodb, neo4j

Article directory Preface mysql Pull image Run container redis Pull image Run container mongodb Pull image Run container neo4j Pull image Run container docker-compose General configuration Use .env files for environment variable configuration .env file case docker-compose.yml file case Bug description Summarize Foreword In the world of software development, the database is an indispensable part, […]

52.MongoDB replication (copy) set actual combat and analysis of its principles

MongoDB replica set architecture High availability In a production environment, it is not recommended to use a stand-alone version of the MongoDB server. A Mongodb replication set (Replication Set) consists of a set of Mongod instances (processes), including a primary node and multiple secondary nodes. All data from the Mongodb Driver (client) is written to […]

MongoDB replica set adjustment node

Click the blue words above to follow me MongoDB’s Replica Set is a high-availability, scalability, and redundancy database solution. It can ensure high availability of the database while ensuring data security. In this article, we will explore how to add a quorum node to a replica set cluster that already contains three data nodes, and […]

MongoDB time series collection

MongoDB time series collection Time series data Time series data is a series of data that changes over time. Time series data consists of 3 components time. Data recording time metadata. Sometimes also called the source of data. Unique time series data is identified by a series of labels or tags. Very little changes. Measurements. […]

Highly available MongoDB cluster

1. Preface MongoDB is a scalable, high-performance, open source, schema-free, document-oriented database. It is written in C++. MongoDB includes the following features: l? Collection-oriented storage: suitable for storing objects and data in JSON form. l? Dynamic query: Mongo supports a variety of query methods. The query instructions use JSON format tags to easily query objects […]

Go language operation MongoDb

Article directory Connect to the database Insert into database Insert a piece of data Insert data in batches Query data Compound queries using BSON Aggregation query update data delete data Connect to database package main import ( “context” “go.mongodb.org/mongo-driver/mongo” “go.mongodb.org/mongo-driver/mongo/options” “log” ) var mgoCli *mongo.Client func initDb() {<!– –> var err error clientOptions := options.Client().ApplyURI(“mongodb://localhost:27017”) […]

MongoDB concept analysis

MongoDB concept analysis No matter what database we study, we should learn the basic concepts. The basic concepts in mongodb are documents, collections, and databases. Let’s introduce them one by one below. The following table will help you understand some concepts in Mongo easier: SQL terms/concepts MongoDB terms/concepts Explanation/Explanation database database database table collection Database […]

Percona MongoDB 4 builds a replica set

What is a replica set: Is a set of mongod processes that maintain the same data set Provides redundancy, automatic failover and high availability Provides read scalability The internal concepts are more or less similar to those of MySQL PRIMARY concept is roughly the same as MASTER in MySQL replication The SECONDARY concept is roughly […]