In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor to share with you is how to use pomelo to connect redis, many people do not understand, today, in order to let you know more about the method of connecting pomelo to redis, so to sum up the following content, let's look down together. I'm sure you'll get something.
How pomelo connects to redis:
1. Add code to app.js
Var redis = require ("redis"); var client = redis.createClient (6379, "127.0.0.1", {}); / / Connect client.on ("error", function (err) {/ / bind redis database error callback console.error ("Redis:Error:" + err);}); app.set ("redis", client); / / app provider
2. Add code to GoodsService.js
Var redis= app.get ("redis"); / / get the redis object redis.set ("name", "caoshanshan", function (err, rep) {/ / insert data console.log ("Redis:" + rep); / / callback})
3. Testing
View redis data with redisclient-win32.x86.1.0
4. Disable redis,pomelo to display error message (bind at app.js)
On how to use pomelo to connect redis to share here, of course, not only the above and everyone's analysis, but the editor can ensure that its accuracy is absolutely no problem. I hope that the above content can have a certain reference value for everyone, and can be put into practice. If you like this article, you might as well share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.