In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.