0
下面的代碼修改設定值給出錯誤: -Redis的: - 獲取的關鍵
redisClient.get('aKey', function(err, aValue){
//some operations.
redisClient.set('aKey', aDashValue, function(err){
if(err){ throw err };
console.log('redisClient set sessionKey');
});
});
我想: - 1.使用鍵的值。 2.修改值3.設置值。這3個步驟需要連續完成。
編輯:
SyntaxError: Unexpected token u
at Object.parse (native)
at /Users/apple/Documents/herokuApp/node_modules/connect-redis/lib/connect-redis.js:97:23
at try_callback (/Users/apple/Documents/herokuApp/node_modules/redis/index.js:580:9)
at RedisClient.return_reply (/Users/apple/Documents/herokuApp/node_modules/redis/index.js:670:13)
at ReplyParser.<anonymous> (/Users/apple/Documents/herokuApp/node_modules/redis/index.js:312:14)
at ReplyParse
而錯誤是...? –
將其放入編輯。我無法追蹤錯誤的含義。有一個指揮問題的相關性。 –
我想你的代碼中有一個異常,它不能轉化爲可以由「on error」處理程序處理的東西。我會刪除「if(err){throw err};」並在控制檯上顯示err。 –