Export to language doesn't allow new Date() even when exporting to JS/Node.js

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: Export to Language
    • None
    • Not Needed
    • None

      Slack thread: https://mongodb.slack.com/archives/C0U7K0MC3/p1623423645061500

      Pipeline:

      [{
          $match: {
              timestamp: {
                  $gte: new Date(new Date() - 7 * 60 * 60 * 24 * 1000)
              }
          }
      }, {
          $group: {
              _id: "$requestedRoute",
              "hits": {
                  "$sum": 1
              }
          }
      }, {
          $match: {
              hits: {
                  $gt: 1
              }
          }
      }, {
          $sort: {
              hits: -1
          }
      }]
      

      works fine but displays "newDate is not defined" when trying to export to Node.js.

              Assignee:
              Unassigned
              Reporter:
              Anna Henningsen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: