[COMPASS-5870] Export pipeline to Node.js code doesn't work with newer versions of driver Created: 30/May/22  Updated: 29/Oct/23  Resolved: 03/Aug/22

Status: Closed
Project: Compass
Component/s: Export to Language
Affects Version/s: None
Fix Version/s: 1.32.6

Type: Bug Priority: Major - P3
Reporter: Matthew Thompson Assignee: Anna Henningsen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to COMPASS-4897 Update export to language syntax to n... Closed
Story Points: 3
Documentation Changes: Not Needed
Sprint: Iteration Grouper

 Description   

Problem Statement/Rationale

Exporting simple aggregation pipeline to Node.js doesn't work with recent versions of MongoDB Node.js driver (eg. 4.6.0).

Steps to Reproduce

Export pipeline to Node.js (selecting "Include Import Statements" and "Include Driver Syntax") and then run with a recent version of Node.js driver.

Expected Results

The exported script should execute cleanly.

Actual Results

You will likely see the following error being raised:

/path/to/node_modules/mongodb/lib/collection.js:372
            throw new error_1.MongoInvalidArgumentError('Argument "options" must not be function');
            ^

Additional Notes

Installing an older version of the driver (eg. 3.6.12) allows the script to execute without issue.

Can we please have this code updated to work with both older and newer versions of the driver?



 Comments   
Comment by Githook User [ 28/Sep/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: feat(bson-transpilers): modernize JS exports COMPASS-5870 (#3310)

Fix COMPASS-5870 by emitting modern JS, using import instead of
require, async/await instead of callbacks, and object shorthand
notation.
Branch: update-compass-shell-to-shared-config
https://github.com/mongodb-js/compass/commit/947030316503d22743ae47213925f93d83befcfb

Comment by Githook User [ 30/Aug/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: feat(bson-transpilers): modernize JS exports COMPASS-5870 (#3310)

Fix COMPASS-5870 by emitting modern JS, using import instead of
require, async/await instead of callbacks, and object shorthand
notation.
Branch: compass-settings
https://github.com/mongodb-js/compass/commit/947030316503d22743ae47213925f93d83befcfb

Comment by Githook User [ 15/Aug/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: feat(bson-transpilers): modernize JS exports COMPASS-5870 (#3310)

Fix COMPASS-5870 by emitting modern JS, using import instead of
require, async/await instead of callbacks, and object shorthand
notation.
Branch: COMPASS-5940-indexes-css-js
https://github.com/mongodb-js/compass/commit/947030316503d22743ae47213925f93d83befcfb

Comment by Githook User [ 05/Aug/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: feat(bson-transpilers): modernize JS exports COMPASS-5870 (#3310)

Fix COMPASS-5870 by emitting modern JS, using import instead of
require, async/await instead of callbacks, and object shorthand
notation.
Branch: electron-15
https://github.com/mongodb-js/compass/commit/947030316503d22743ae47213925f93d83befcfb

Comment by Githook User [ 04/Aug/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: feat(bson-transpilers): modernize JS exports COMPASS-5870 (#3310)

Fix COMPASS-5870 by emitting modern JS, using import instead of
require, async/await instead of callbacks, and object shorthand
notation.
Branch: hide-explain-toolbar-until-explain-is-run
https://github.com/mongodb-js/compass/commit/947030316503d22743ae47213925f93d83befcfb

Comment by Githook User [ 03/Aug/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: feat(bson-transpilers): modernize JS exports COMPASS-5870 (#3310)

Fix COMPASS-5870 by emitting modern JS, using import instead of
require, async/await instead of callbacks, and object shorthand
notation.
Branch: 1.32-releases
https://github.com/mongodb-js/compass/commit/947030316503d22743ae47213925f93d83befcfb

Comment by Githook User [ 01/Aug/22 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna@addaleax.net', 'username': 'addaleax'}

Message: feat(bson-transpilers): modernize JS exports COMPASS-5870

Fix COMPASS-5870 by emitting modern JS, using import instead of
require, async/await instead of callbacks, and object shorthand
notation.
Branch: 5870-dev
https://github.com/mongodb-js/compass/commit/c2f28d9a4279ea26ed8c7593c4d23ea1d0b49357

Generated at Wed Feb 07 22:41:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.