Created
March 28, 2012 21:52
-
-
Save mstyne/2230892 to your computer and use it in GitHub Desktop.
couch view... relax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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