Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3259

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.8.1
    • Shell
    • Mac OSX 10.6.7 64 bit
    • ALL

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: