Created
November 4, 2013 22:18
-
-
Save neumino/7310162 to your computer and use it in GitHub Desktop.
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
r.db('test').table('test').map( function(doc) { | |
return r.expr(['id', 'value']).map( function(key) { | |
return r.expr([[key, r.expr([[doc(key).typeOf().default('UNDEFINED'), 1]]).coerceTo('OBJECT')]]).coerceTo('OBJECT') | |
}).reduce( function(left, right) { | |
return left.merge(right) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment