adding to my previous post…
- I noticed you use
.jsextension. top level async/await is not possible that way. you can use.mjsextension instead to run such tests. you can later set your project type to module system. - check the example here (check menus on the left for other info): Connect to MongoDB — Node.js Driver
- check this tutorial: Express.js And MongoDB REST API Tutorial | MongoDB
Sometimes, the answer might be obvious but we may fail to see it. That happens all the time. Unfortunate I don’t have a proper setup to test your code. Try my suggestions so you may see it yourself (and learn things you miss on the way), or maybe you are lucky and someone else with a sharp eye comes in.
Cheers ![]()