date - Get day of month of timestamp in Mongodb -
is there operation of mongodb use retrieve day of month out of timestamp, inside aggregation?
i this:
{"$dayofmonth" : "$timestamp"}
if not possible, best way convert "$timestamp" mongodb date format?
yes there $dayofmonth aggregation operator.
db.blah.insert({ts:new date("2014-02-01")}) db.blah.aggregate([{$project:{dayofmonth:{$dayofmonth:"$ts"}}}])
Comments
Post a Comment