-1
私はNodejsで私のアプリにAWS elasticache(memcache)を設定しようとしています。私の場合、キャッシュにデータを保存する方法は?
私はキャッシュにJSONオブジェクトを格納したいと
elastic.connect().then(function(instance){
var profile = {
'name':'Rohit kumar',
'location':'Delhi',
'emailid':'[email protected]'
}
instance.set('profile', profile, false, 10000);
instance.get('profile').then(function(cacheData){
console.log(cacheData);
});
});
に「get
」の後の文字列としてcacheData
リターン[object object]
をしました。
何らかの理由で値が文字列であれば、私が設定して取得することができたではなく、オブジェクト
instance.set('profile', 'profile 1 string', false, 10000);
instance.get('profile').then(function(cacheData){
console.log(cacheData); // get 'profile 1 string'
});
はelasticache
JSONを扱うことはできますか?私はそれができないなら弱いと思った。
ありがとうございました!
私はなぜdownvoteを聞くことができますか? – Jwqq