npm:mongodb connection issue, timeout
After facing bson corrupt errors frequently with https://deno.land/x/mongo@v0.33.0/mod.ts we started exploring options and replaced it with npm:mongodb@6.14.3 (latest) but facing connection issues with both Username - Password/X.509 auth options.
Has anyone connected to mongodb recently with deno version 2, guide me on setting up the connection. we are facing timeout error with usernamee-password auth mechanism. X.509 has other issues.
1 Reply
It's resolved, mongodb documentation for nodejs was useful.
Since importing
MongoClient
from deno package (https://deno.land/x/mongo@v0.33.0/mod.ts) was giving frequent BSONError: corrupt object bson
so migrated to npm:mongodb
The serverApi object passed to MongoClient is important to connect mongodb using nodejs/deno.