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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -