Redis three special data types

geospatial location

Add geographic location, parameters (latitude, longitude, name)
Insert picture description here

Get the longitude and latitude of the specified city
Insert picture description here

Get the distance between two places
Insert picture description here

Specify the latitude and longitude as the center, find the city within the given radius
Insert picture description here

Specify the city as the center to search for cities that exist within the specified radius
Insert picture description here

The bottom layer of geo is zset
Insert picture description here

Hyperloglog

No repeating elements

Test use
Insert picture description here

bitmap

Bit storage

Statistics user information, active, inactive! Login, not logged in! Check in, check in 365! Both states can use Bitmaps! Bitmaps bitmap, data structure! All operating binary bits for recording, only 0 and 1 Two states!

Test: Seven days a week, clock in is 1, otherwise it is 0
Insert picture description here

Count the number of clock-in days
Insert picture description here

Guess you like

Origin blog.csdn.net/AIJXB/article/details/113835311