Mongodb epoch time values in number form -- how to query?
I have data in mongo that stores time values in number form (epoch). How can I do date based queries on it?
-
Official comment
for Epoch with milliseconds, use the date tokens with the millis.
Example:
$c9_today-1d|millis
For Epoch in seconds, use epoch identifier
$c9_today-1d|epoch
Example:
db['someColl'].find({ 'createdate': { $gte: "$c9_today-1d|millis"} });
Comment actions
Please sign in to leave a comment.
1 comment