[COMPASS-4881] Export to language doesn't allow new Date() even when exporting to JS/Node.js Created: 11/Jun/21 Updated: 16/Sep/21 Resolved: 16/Jun/21 |
|
| Status: | Closed |
| Project: | Compass |
| Component/s: | Export to Language |
| Affects Version/s: | None |
| Fix Version/s: | No version |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Anna Henningsen | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Documentation Changes: | Not Needed |
| Description |
|
Slack thread: https://mongodb.slack.com/archives/C0U7K0MC3/p1623423645061500 Pipeline:
works fine but displays "newDate is not defined" when trying to export to Node.js. |
| Comments |
| Comment by Massimiliano Marcon [ 16/Jun/21 ] |
|
This type of pipeline is hard to map to different programming languages when exporting it to code. It's best to take advantage of the aggregation's variable $$NOW and subtract time from there directly in MQL. |