I am not sure. When exactly are you getting this error?
I encountered the same problem. It turns out I was doing the mongodb import in a Svelte component, where global is not present. It works fine in a JS endpoint — which is where it would go in a real app.
global
Sure thing, never connect directly to your database from the client. That would be really dangerous practice.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I am not sure. When exactly are you getting this error?
I encountered the same problem. It turns out I was doing the mongodb import in a Svelte component, where
global
is not present. It works fine in a JS endpoint — which is where it would go in a real app.Sure thing, never connect directly to your database from the client. That would be really dangerous practice.