Created
November 9, 2011 21:38
-
-
Save jgyllen/1353155 to your computer and use it in GitHub Desktop.
Equivalent of using MongoDB's $size operator for embedded collections
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
# All activities with one comment or more | |
Activity.collection.find('$where' => "function() { if (this['activity_comments'] && this['activity_comments'].length > 0) return true; }") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment