Last active
August 29, 2015 14:22
-
-
Save elsehow/5d2a7e8c53042ba26058 to your computer and use it in GitHub Desktop.
Couch DB views or for indra
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
// here are a couple couchDB views I think might be handy | |
// use these as tempaltes for some views of your own | |
// if you're starting from a fresh couchDB, you'll have to add these views to a design document - consult couchDB reference for more info | |
// byCreatedAt | |
function(doc) { | |
var type, data, createdAt; | |
if (doc.type && doc.data && doc.createdAt) { | |
emit(doc.createdAt, doc); | |
} | |
} | |
// byType | |
function(doc) { | |
var type, data, createdAt; | |
if (doc.type && doc.data && doc.createdAt) { | |
emit(doc.type, doc); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment