how do I return all memcached values in Google App Engine?

白昼怎懂夜的黑 提交于 2020-01-03 15:37:09

问题


I want to use all the data in my python app engine memcache. I do not know the keys in advance.

How do I go about getting all data?


回答1:


The only read functions available on memcache are:

get(key, namespace=None)

get_multi(keys, key_prefix='', namespace=None)

As you can see, to get data from memcache you must provide one or more keys.




回答2:


I am using a 'well known key' called "config" where I store a list of all other keys and use that to enumerate the rest of the items.




回答3:


as in comments above, I guess I could stick all data in a single memcache entry with a known key.

Still for non-static data there are scenarios where it would be useful.



来源:https://stackoverflow.com/questions/3611830/how-do-i-return-all-memcached-values-in-google-app-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!