• [Mr. Zhao Qiang] index in mongodb (Part 2)


    (4) Type 3 of index: compound index Mongodb supports composite indexes, that is, multiple keys are combined to create indexes. This method is called composite index, or composite index. This method can meet the use of index in multi key value matching query. Secondly, when using a composite index, you can also use the index […]

  • Elasticsearch integrates springboot


    Official documents 1. Find native dependencies <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>elasticsearch-rest-high-level-client</artifactId> <version>7.9.2</version> </dependency> 2. Find object 3. Analyze the methods in this class Configure basic items Problem: make sure that the dependencies we import are consistent with those we use Related source code Specific API testing 1. Create index2. Determine whether the index exists3. Delete index4. Create […]

  • [Java from pit entry to abandonment] No 5. Control process


    preface We areLast articleThe use skills of various operators are described in, followed by the contents of the previous article. This article mainly focuses on process control. The main contents of the article are arranged as follows: Input and output Conditional judgment Control cycle Input and output input To input from the console and read […]

  • [high concurrency] Interviewer: synchronized is provided in Java. Why lock?


    Write in front The synchronized keyword is provided in Java to ensure that only one thread can access the synchronized code block. Since the synchronized keyword has been provided, why is the lock interface provided in the SDK package of Java? Is it unnecessary to build wheels repeatedly? Today, let’s discuss this problem together. Reconstituted […]

  • Sub link query and special query of MySQL basic syntax (Union and limit)


    Subqueries and special queries (Union and limit) The syntax of sub query and special query in MySQL is summarized Subquery Sub queries are divided intoSubquery in where statement、Subquery in from statement、Subquery in select statement Because the subquery in the select statement is rarely used, the following tests only correspond to the subquery in the where […]

  • Learning notes: basic statements of MySQL


    MySQL basic introductory statement Add: Insert into table name (field 1, 2, 3) values (‘value 1 ‘,’2’,’3 ‘) Delete: Delete from indicates where to delete the condition If the update condition is not provided, all items will be deleted Change: Update table name set field 1 =’New value ‘, field 2 =’New value’ where update […]

  • Rich resolution scenarios of where query conditions in eloquent ORM


    Personal feelingsEloquent ORMOfwhereThe scenario of conditional parsing is not so rich, and many conditional assemblies need to introduce additional conditionsorWhere, whereNotIn, whereBetween, whereNotBetweenTo assist in this. This is not very friendly when doing some abstract bottom query methods, and the query conditions passed by the upper layer are uncertain. If you can flexibly parse all […]

  • Six suggestions on optimizing and refactoring Python code


    Merging nested if conditions Too much nesting makes the code hard to understand, especially in Python, because Python doesn’t have parentheses to help distinguish between different nesting levels. Reading deeply nested code can be annoying because you have to figure out which conditions belong to which level. Therefore, we should reduce nesting as much as […]

  • C language foundation (6) program structure — branch (selection) structure [2]


    Although the program of sequence structure can solve the problems of calculation and output, it can’t judge and choose again. For the problem of judgment before selection, the branch structure should be used. The execution of the branch structure is to choose the execution path according to certain conditions, rather than strictly according to the […]

  • Dynamic refresh configuration by integrating Apollo with springboot


    Introduction to distributed Apollo Apollo is an open source configuration management center developed by Ctrip framework department. It can centrally manage the configuration of different application environments and clusters. After configuration modification, it can be pushed to the application end in real time, and has the characteristics of standard permissions and process governance. This article […]

  • Conditions and cycles


    loop Go language only supports the circular keyword for for i := 0; i<5; i++ “>for i := 0; i<5; i++ Examples While conditional loop while(n<5) n := 0 for n < 5 { n++ fmt.Println(n) } “>n := 0 for n < 5 { n++ fmt.Println(n) } While infinite loop while(true) for { … […]

  • Table connection method


    There are four ways to join Oracle tables Sort merge join Nested loops join Hash join Cartesian product Sort merge join Sort merge join is to sort two connected tables with join columns, merge the sorted result set, and then get matching records. If there is an index on the join column to avoid sorting, […]