Created
November 2, 2010 18:54
-
-
Save jraines/660100 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
#two questions -- why does .count not return the narrowed down result set size, and why does .where seem to alter variable a? | |
a = Star.where(:brightness => 0) | |
=> #<Mongoid::Criteria:0xb6af2948 @documents=[], @options={}, @selector={:brightness=>0}, @klass=Star> | |
a.size | |
=> 1430 | |
a.count | |
=> 1430 | |
a.where(:name => /local/).count | |
=> 1430 | |
a.where(:name => /local/).size | |
=> 286 | |
a.count | |
=> 1430 | |
a.size | |
=> 286 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment