Last active
December 10, 2015 20:48
-
-
Save flyinprogrammer/4490672 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
#!/usr/bin/env ruby | |
require 'date' | |
require 'mongoid' | |
Mongoid::Config.connect_to("email_test") | |
class Email | |
include Mongoid::Document | |
field :headers | |
field :received | |
field :date, :type => DateTime | |
field :to | |
field :from | |
field :subject | |
field :body | |
end | |
puts Email.where(:date.gte => DateTime.parse(Time.now.to_s)).count | |
## Fixed | |
But wth is going on with ":date.gte" <-- i.e. how does that create a key value for the hash? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment