[COMPASS-5112] $function NOT working in Node → Returns error 31261 Created: 27/Sep/21 Updated: 16/Nov/21 Resolved: 27/Sep/21 |
|
| Status: | Closed |
| Project: | Compass |
| Component/s: | Aggregation pipeline, Export to Language |
| Affects Version/s: | None |
| Fix Version/s: | 1.29.4 |
| Type: | Bug | Priority: | Blocker - P1 |
| Reporter: | max matinpalo | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Node 16.9.1 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Documentation Changes: | Not Needed | ||||||||
| Description |
$function works fine in compass but not in NodeCreated example pipeline with $function inside compass → works fine. Exporting this pipeline to node throws error 31261. Pipeline in attachment. |
| Comments |
| Comment by max matinpalo [ 27/Sep/21 ] |
|
Thank You very much Alena for your fast solution |
| Comment by Alena Khineika [ 27/Sep/21 ] |
|
The error that currently accrues is: `MongoError: Invalid $addFields :: caused by :: The body function must be specified` The node driver expects the $function's body to be a string. With the 1.28.5 Compass release, we will provide a fix for the `Export to Language` module so the $function's body will be exported as a string instead of an object value. |