Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.