initial commit

This commit is contained in:
Kevin Gaudin 2012-11-12 23:55:52 +01:00
commit 8a10168d52
7 changed files with 30 additions and 0 deletions

3
.couchapprc Normal file
View File

@ -0,0 +1,3 @@
{
"env": {}
}

1
_id Normal file
View File

@ -0,0 +1 @@
_design/acra-storage

1
language Normal file
View File

@ -0,0 +1 @@
javascript

5
validate_doc_upddate.js Normal file
View File

@ -0,0 +1,5 @@
function(newDoc, oldDoc, userCtx) {
if(userCtx.roles.indexOf("reporter") < 0) {
throw({"forbidden": "You may only update documents with reporter role "});
}
}

View File

@ -0,0 +1,9 @@
function(doc) {
if (doc.USER_CRASH_DATE) {
emit(new Date(doc.USER_CRASH_DATE), {
user_crash_date: doc.USER_CRASH_DATE,
stack_trace:doc.STACK_TRACE,
android_version : doc.ANDROID_VERSION
});
}
};

View File

@ -0,0 +1,8 @@
function(doc) {
if(doc.USER_CRASH_DATE) {
var crashDate = new Date(doc.USER_CRASH_DATE);
if(crashDate.getFullYear() > 2000) {
emit([crashDate.getFullYear(), crashDate.getMonth() , crashDate.getDate()], 1);
}
}
}

View File

@ -0,0 +1,3 @@
function(keys, values, rereduce) {
return sum(values);
}