Skip to content

Instantly share code, notes, and snippets.

@iyanski
Created March 30, 2012 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iyanski/2252763 to your computer and use it in GitHub Desktop.
Save iyanski/2252763 to your computer and use it in GitHub Desktop.
Counting results when specifying limit() in mongoid initially did not work
1.9.2p290 :022 > Photo.all.count
=> 21
1.9.2p290 :023 > Photo.where(orientation: 'portrait').limit(2).count
=> 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment