Created
October 31, 2011 16:36
-
-
Save jeffdeville/1327915 to your computer and use it in GitHub Desktop.
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
| map = -> | |
| return unless this.users instanceof Array | |
| for user_id in this.users when !user_id.equals(current_user) | |
| emit(user_id, {interests_in_common: 1}) | |
| reduce = (user_id, emits) -> | |
| result = {interests_in_common: 0} | |
| result.interests_in_common += emit.interests_in_common for emit in emits | |
| result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment