Tag:array

  • Mongoose Series II update

    Time:2020-4-5

    findOneAndUpdate() Model.findOneAndUpdate(filter, update[, options][, callback]) Parameter 1: filter The query statement is the same as find() filterby{}, update the first data Parameter 2: update {operator: { field: value, … }, … } Must useupdateOperator If there is no operator or the operator is notupdateOperators, unified as$setOperation (unique to mongoose) Update operator Field related operators Symbol […]

  • Spring 5 source code analysis series (8) – XML based dependency injection (2)

    Time:2020-4-5

    Foreword: in the previous article, we talked about the dependency injection of populatebean method to bean attribute, and we will continue the following content in this article. 7. Beandefinitionvalueresolver resolves property values When the container performs dependency injection on the property, if it finds that the property value needs to be type converted, for example, […]

  • [leetcode algorithm weekly] issue 5

    Time:2020-4-5

    The official account of WeChat’s public front growth story is written in 2019.12.06. background This paper records the whole thinking process in the process of writing questions for reference. The main contents include: Assumption of topic analysis Write code validation Consult others’ solution Thinking and summing up Catalog 100. Same tree 101. Symmetric binary tree […]

  • Common methods and properties of arrays in JS

    Time:2020-4-5

    This paper summarizes the common methods and attributes of arrays in JS Three ways to create an array 1. Conventional method var arr = new Array (); arr[0]=”abc”; arr[1]=”def” 2. Simple way var arr = new Array(“abc”,”def”); 3. Literal measure var arr = []; arr=[“abc”,”def”]; perhaps var arr=[“abc”,”def”] Properties of an array object attribute describe […]

  • Array of data structure

    Time:2020-4-5

    What is an array? An array is a data structure composed of a collection of elements of the same type and is allocated a continuous block of memory for storage. The storage address of the element can be calculated by its index.One dimensional array is the simplest array, just like int [] data = {1,2,3}.In […]

  • Mongoose series 3 Create create create document

    Time:2020-4-4

    save() Model.prototype.save([options][, callback]) Document.prototype.save([options][, callback]) The document to save does not contain_idField, insert a new document, similar toinsert()。 The document to save contains_idField, update the document, equivalent toupdate(filter,update,{upsert: true}) The document to save contains_idField (must beObjectIdForm), but_idIf the value of does not exist in the collection, a new document is inserted,_idThe field uses the value […]

  • Redis underlying data structure

    Time:2020-4-4

    Simple dynamic string SDS Include string length, remaining available length, character array Used for all thestringstorage Dictionary (map) Array + linked list, similar to HashMap Solving hash conflict by chain address method Rehash uses the new hash array linked list for data rehash migration. The capacity expansion is the first 2 n power greater than […]

  • PHP to insert, delete and replace arrays to any location

    Time:2020-4-4

    The example of this paper describes how to insert, delete and replace data in any place in PHP. To share with you for your reference, as follows: Array_splice function can be used to insert, delete and replace any position array array_splice ( array &$input , int $offset [, int $length = count($input) [, mixed $replacement […]

  • ES6 image switching effect

    Time:2020-4-4

    Design sketch demo.html Document <span style=”background-color: #f5f5f5; color: #000000;”> F5f5f5; color: × 000000; “> front end < / span > < span style =” background color: × f5f5; color: × 000000; “>”</span><span style=”background-color: #f5f5f5; color: #000000;”>, </span><span style=”background-color: #f5f5f5; color: #000000;”>”</span><span style=”background-color: #f5f5f5; color: #000000;”>jquery</span><span style=”background-color: #f5f5f5; color: #000000;”>”</span><span style=”background-color: #f5f5f5; color: #000000;”>, </span><span style=”background-color: […]

  • “Linked list” of data structure

    Time:2020-4-3

    What is a linked list? Linked list is a kind of linear list, but it does not store data in linear order, but stores the pointer to the next node in each node. Therefore, it does not need to allocate continuous storage space, and does not need to fix the size of elements in advance. […]

  • Vue for seamless text scrolling (scrolling from bottom to top)

    Time:2020-4-2

    Demand: rolling effect display for winning users There are still a lot of requirements for this effect. I want to use it beforeJQueryA seamless roll (remembering the past) is achieved through JQanimateMethod, after the animation is finished, the first elementappendToAdd to the back, to achieve circular scrolling effect, we have to sigh that the technology […]

  • Linux shell programming syntax

    Time:2020-4-1

    Shell, commonly known as shell, is a Linux command and a programming language, which has many syntaxSH, as we often say, is generally only bash, that is, Bourne again shell, which is widely used in daily work due to its ease of use and free of charge. Bash is also the default shell for most […]