problem setting and getting data

rkmr.em at gmail.com rkmr.em at gmail.com
Sat Oct 27 14:38:07 UTC 2007


oops sorry ! wrong list

On 10/27/07, rkmr.em at gmail.com <rkmr.em at gmail.com> wrote:
>
> Hi,
> I installed the memcachedb with BerkelyDB and libevent. I am using the
> latest python 1.4 client.
> If I set an integer and get it I get a string. Is this the expected
> behavior? And for a list I get serialized data......
>
> this is how i started the memcachedb:
> sudo env LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.6/lib  ./memcachedb -p
> 22222 -l 127.0.0.1 -f database.db -H /home/mark/Desktop/junk/memcachedb-
> 0.0.4 -u mark -P memcache.pid -d
>
> from python shell....:
>
> >>> mc = memcache.Client(['127.0.0.1:22222'])
> >>> mc.set('1', 0)
> True
> >>> mc.get('1')
> '0'
> >>> mc.set('key', 100)
> True
> >>> mc.get('key')
> '100'
> >>> a=mc.get('key')
> >>> type(a)
> <type 'str'>
> >>> mc.incr('key')
> 101
> >>> mc.decr('key')
> 100
> >>> a=mc.get('key')
> >>> a
> '100'
> >>> mc.incr('key')
> 101
> >>> a=mc.get('key')
> >>> a
> '101'
> >>> mc.set('key',[1])
> True
> >>> mc.get('key')
> '(lp1\nI1\na.'
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20071027/d2c4bcd0/attachment.html


More information about the memcached mailing list