1.14. Memcached incr and decr commands

发布时间 :2025-10-25 12:24:30 UTC      

Memcached incr and decr command is used for existing key the numeric value of (key) is used for self-increasing or self-decreasing operation.

incr and decr the data for the command operation must be a decimal 32-bit unsigned integer.

If key has no return NOT_FOUND , the value of the key is nota number, returns CLIENT_ERROR other errors are returned ERROR .

1.14.1. incr command

Syntax:

The incr basic syntax format of the command is as follows:

incr key increment_value

The parameters are described as follows:

  • key :Key value key-value in the structure key used to find cached values

  • increment_value :The increased number.

1.14.2. Example

In the following example, we use the visitors as key the initial value is 10, and then add 5.

set visitors 0 900 2
10
STORED
get visitors
VALUE visitors 0 2
10
END
incr visitors 5
15
get visitors
VALUE visitors 0 2
15
END

1.14.3. Output

Output information description:

  • NOT_FOUND : key doesn’t exist.

  • CLIENT_ERROR :Self-increment is not an object.

  • ERROR other errors, such as grammatical errors.

1.14.4. decr command

The decr basic syntax format of the command is as follows:

decr key decrement_value

The parameters are described as follows:

  • key :Key value key-value in the structure key used to find cached values

  • decrement_value :The reduced number.

Example

set visitors 0 900 2
10
STORED
get visitors
VALUE visitors 0 2
10
END
decr visitors 5
5
get visitors
VALUE visitors 0 1
5
END

In the following example, we use the visitors as key with an initial value of 10, followed by minus 5

1.14.5. Output

Output information description:

  • NOT_FOUND : key doesn’t exist.

  • CLIENT_ERROR :Self-increment is not an object.

  • ERROR other errors, such as grammatical errors.

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.