I know there is no way to compare two fields from the same document in MongoDB 2.0:
db.foo.save({
"_id" : ObjectId("5037f1d19cb590b9b72a2558"),
"update-date" : ISODate("1970-01-01T00:00:00Z"),
"read-date" : ISODate("2012-08-24T21:27:37.070Z")
})
db.foo.find({"read-date' : { $gt : "update-date" }})
Is there some way to do this in 2.2 with the new aggregation framework? Dates or integers (epoch for instance) would be fine.
Thanks,
Geoff