When Redis reads an integer of a string type, it is treated as an integer directly

Source: Internet
Author: User

An interesting question today is that when the system loads a string type of shaping data from MySQL into Redis and then takes it out of Redis, its type becomes an integer type, and the procedure is as follows:

The key in the database is a varchar-type number, such as a date type that 4,value is a varchar type, such as 2014-12-19

It is then loaded into Redis and then removed from Redis and placed in map<string,string>, but through a string type key, such as "4", it is not possible to extract the date string from map for 2014-12-19, The result of a look at the map of key (4) type, incredibly is an integer type, can only be integer.parse after the get, sure enough to take out, really pit Ah, hereby notes!

This article is from the "General Programmer to CTO" blog, please be sure to keep this source http://1730634.blog.51cto.com/1720634/1591854

When Redis reads an integer of a string type, it is treated as an integer directly

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.