Using a date timestamp with mongo --eval yields zero results

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.8.1
    • Component/s: Shell
    • Environment:
      Mac OSX 10.6.7 64 bit
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When running the query in the mongo shell, the query returns the proper result:

      mongo localhost:27017/development
      > db.statistics.find({'type': 'Hourly', 'statistics_date' : {'$lt': new Date(1307145600000)}}).count();
      21316

      However, when performing the query via eval, the query always returns 0 results.

      mongo localhost:27017/development --eval "db.statistics.find({'type': 'Hourly', 'statistics_date' : {'$lt': new Date(1307145600000)}}).count();"
      MongoDB shell version: 1.8.1
      connecting to: localhost:27017/development
      0

            Assignee:
            Scott Hernandez (Inactive)
            Reporter:
            Ryan Felton
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: