looking for mongo command for timestamp comparison

392 views
Skip to first unread message

Van Phan

unread,
Oct 13, 2011, 2:33:08 PM10/13/11
to mongod...@googlegroups.com
For example:

in MySQL:

Select mydate from <tbl_name> where mydate >= <current date>;

Can you help?

thanks.
-van

Brandon Diamond

unread,
Oct 13, 2011, 3:32:52 PM10/13/11
to mongodb-user
You can use the $gt, $lt, $gte, $lte, etc operators with timestamps.

Brandon Diamond

unread,
Oct 13, 2011, 3:34:18 PM10/13/11
to mongodb-user
To clarify: the "timestamp" BSON type is generally not what you're
looking for. By timestamp, I mean a field containing a Date object:

http://www.mongodb.org/display/DOCS/Dates


On Oct 13, 2:33 pm, Van Phan <vphan2...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages