backend for dogpile.cache with reading and writing on mongodb
Project description
Install
Use pip:
pip install dogpile_mongo
Usage
See the example.
Code:
from dogpile.cache import make_region db = MongoClient()['test'] region = make_region().configure( 'mongo', # arguments are same as mongo backend. arguments={ 'db': db, } ) region.set("test", b"value") region.set_multi({"key1": b"value1", "key2": 100}) print(region.get("test")) print(region.get_multi(["key1", "key2"]))
Result:
$ python main.py b'value' [b'value1', b'100']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dogpile_mongo-0.0.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for dogpile_mongo-0.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99ab222023f60dc86ed502f0efb77e93580577454854e16599978d99b0ef599b |
|
MD5 | 43ecd87da622e2e5f64d6af6c60c748a |
|
BLAKE2b-256 | eda497177acff62dadd334c05b2336bfca707b6e3af99baa6bc539e9feabb165 |