[COMPASS-4680] Support for load() in compass shell Created: 05/Mar/21  Updated: 28/Oct/22

Status: Ready for Work
Project: Compass
Component/s: Embedded Shell
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Anna Henningsen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on MONGOSH-641 load() is not interruptible Closed
Related
is related to MONGOSH-338 Support loading external files to she... Open
Story Points: 3
Sprint: Iteration Xylocarpus Granatum

 Description   

Support loading files from disk using `load()` in the Compass shell. The onLoad() method needs to be filled out for the evaluation listener in use; it should only allow absolute paths.

The __filename and __dirname methods should be set similar to what was implemented in MONGOSH-386, using the same code structure.



 Comments   
Comment by Anna Henningsen [ 17/Mar/21 ]

Fwiw: I’ve uploaded my WIP code in https://github.com/mongodb-js/mongosh/commit/e3245fba86e27601050abdf208a457dc63b492c4.

However, my approach seems doomed because it’s hitting the “Can't run another evaluation while the previous is not finished” error condition in node-runtime-worker-thread, which ensures that only one evaluation can take at any time.

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