I have mongo documents containing a last_active date and a created date. I would like to search for all documents where the day of last_active is not equal
One way to do this would be with $where http://docs.mongodb.org/manual/reference/operator/query/where/ Or you can use aggregate query. Something like this (improve to add fields that you need to retrieve):
db.dates.aggregate({$project: { created: 1, last_active: 1, are_diff: {$ne: ["$created", "$last_active"]}}}, {$match: {are_diff: true}})