I am using MongoId 3,Rails 3.2 ,Ruby 1.9.3.
I wanted to query only part of a date, such as the day, week or month.
So for example, let's say we need to find all users that signed up on a Wednesday OR get all users whose birthday is on 25 day Or get all users who born in April month(not specific to particular year here) etc..
In Mysql we have select * from users where extract(dow from created_at) = 3;
But how can we perform this using MongoId.
Here is a pretty handy cookbook on querying data ranges on Mongodb: http://cookbook.mongodb.org/patterns/date_range/ . and you can just create the query almost in the same way on Mongoid, using
.where