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

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

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

      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 Unassigned
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: