Hi @Jeffrey_G, you are correct that db.loadServerScripts() is a method from the legacy shell. Additionally starting in MongoDB 8.0 server-side JavasScript is deprecated.

The linked page https://www.mongodb.com/docs/upcoming/tutorial/store-javascript-function-on-server/ has been updated to reflect this and offer a alternative solution for mongosh, which is detailed on the https://www.mongodb.com/docs/mongodb-shell/write-scripts/#std-label-mdb-shell-write-scripts. I hope this helps clear up some of the confusion!