Created
December 11, 2013 01:30
-
-
Save neumino/7903626 to your computer and use it in GitHub Desktop.
@bencevans - Twitter - 2013/12/10
This file contains hidden or 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
r.db("ScrobbleGraph").table("scrobbles").groupedMapReduce( | |
function(doc) { return doc("date").date() }, | |
function(doc) { return [doc] }, | |
function(left, right) { return left.add(right)} | |
) | |
// It's better to use just an orderBy and group on the client because | |
// - The database won't have to keep everything in memory | |
// - It's faster because of the index | |
r.db("ScrobbleGraph").table("scrobbles").orderBy({index: "date"}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment