Skip to content

Instantly share code, notes, and snippets.

@mstyne
Created March 28, 2012 21:52
Show Gist options
  • Save mstyne/2230892 to your computer and use it in GitHub Desktop.
Save mstyne/2230892 to your computer and use it in GitHub Desktop.
couch view... relax
function(doc) {
if (doc.hasOwnProperty('iso_timestamp')) {
var then = new Date(doc.iso_timestamp),
now = new Date(),
diff = now - then;
//if (diff > 60) {
emit(doc.instance_url,then);
//}
} else {
emit(doc.instance_url);
}
}
"2012-03-28T17:45:46-04:00"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment