memcached node js client

27 views
Skip to first unread message

nit...@cloudion.net

unread,
Oct 7, 2015, 6:57:51 AM10/7/15
to memcached
I am using memcached node js client. I am not getting the JSON output when performing the get operation on it. Here is my code

memcached.get(id, function( err, result ){
  if( err ) console.error( err );
  console.log( result );
});
and the output is 

a:2:{s:7:"passkey";s:40:"8c779538d8c4ed54cf8a89d1e59518557febf0ac";s:7:"userkey";s:7:"5b9ce84";}
How to get the userkey from this output or how to get the output as json?

David Sheldon

unread,
Oct 7, 2015, 9:46:40 AM10/7/15
to memc...@googlegroups.com
Looks like your problem is that you haven't put JSON into memcached.
That looks a bit like PHP serialisation format. Maybe call json_encode
in your PHP. If you can't do that, it looks like people have created
some nasty node.js php unserializers. Like
https://github.com/naholyr/js-php-unserialize

David

Nithish Mohan

unread,
Oct 7, 2015, 1:51:12 PM10/7/15
to memc...@googlegroups.com
Thank u David.. It works


--

---
You received this message because you are subscribed to a topic in the Google Groups "memcached" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/memcached/zD0KEYI38NA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to memcached+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages