DEV Community

Discussion on: Connect to MongoDB Atlas from SvelteKit

Collapse
 
kolosseo profile image
kolosseo

Thank you for the post. Anyway, I need to show two errors in the code:

  • I had to add async before client.connect() otherwise it didn't work.
  • dbConnection is undeclared. It has to be substituted with clientPromise (probably a typo).
Collapse
 
kvetoslavnovak profile image
kvetoslavnovak • Edited

Thank you for your comment on typo. I have corrected it.
I did not need the async to have a working code but I guess it depends, the official documentation does not mention it.