git://git.onelab.eu
/
myops.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Add scripts to create myops-getqueryview:
[myops.git]
/
web
/
query
/
vendor
/
couchapp
/
lib
/
cache.js
1
exports.get = function(db, docid, setFun, getFun) {
2
db.openDoc(docid, {
3
success : function(doc) {
4
getFun(doc.cache);
5
},
6
error : function() {
7
setFun(function(cache) {
8
db.saveDoc({
9
_id : docid,
10
cache : cache
11
});
12
getFun(cache);
13
});
14
}
15
});
16
};
17
18
exports.clear = function(db, docid) {
19
db.openDoc(docid, {
20
success : function(doc) {
21
db.removeDoc(doc);
22
},
23
error : function() {}
24
});
25
};