Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-4440

Date objects should stringify to an ISO date value consistent with mongosh

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.24.1
    • None
    • Embedded Shell
    • None
    • 3
    • Not Needed
    • Iteration Papaya

    Description

      In Compass 1.22.1, Date and ISODate objects evaluate to {} in the embedded shell:

      >  foo = new Date("2020-10-07")
      < {}
       
      > foo.toJSON()
      < '2020-10-07T00:00:00.000Z'
       
      > typeof foo
      < 'object'
      

      The expected result would be an ISO date similar to the toJSON() output. Example from standalone mongosh:

      > foo = new Date("2020-10-07")
      2020-10-07T00:00:00.000Z
      

      Attachments

        Activity

          People

            anna.henningsen@mongodb.com Anna Henningsen
            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: