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

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.24.1
    • Affects Version/s: None
    • Component/s: Embedded Shell
    • None
    • 3
    • Iteration Papaya
    • Not Needed

      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
      

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

              Created:
              Updated:
              Resolved: