D
Deno

help

Error connecting to MongoDB Atlas

Ccxx2/24/2023
Hello, I'm trying to connect to MongoDB Atlas via mongoose (npm:mongoose) but encountered the following error:
error: Uncaught MongoAPIError: Server record does not share hostname with parent URI
at resolveSRVRecord (file:///home/farish/.cache/deno/npm/registry.npmjs.org/mongodb/4.14.0/lib/connection_string.js:63:19)
at async file:///home/farish/.cache/deno/npm/registry.npmjs.org/mongodb/4.14.0/lib/mongo_client.js:123:31
error: Uncaught MongoAPIError: Server record does not share hostname with parent URI
at resolveSRVRecord (file:///home/farish/.cache/deno/npm/registry.npmjs.org/mongodb/4.14.0/lib/connection_string.js:63:19)
at async file:///home/farish/.cache/deno/npm/registry.npmjs.org/mongodb/4.14.0/lib/mongo_client.js:123:31
My code:
import mongoose from 'npm:mongoose';

await mongoose.connect(
'mongodb+srv://user:pass@main.pj9zc0r.mongodb.net/?retryWrites=true&w=majority',
);
import mongoose from 'npm:mongoose';

await mongoose.connect(
'mongodb+srv://user:pass@main.pj9zc0r.mongodb.net/?retryWrites=true&w=majority',
);
Ccxx2/24/2023
I've added 0.0.0.0/0 to my network access
Ccxx2/24/2023
Solved it
Ooutofcontext9/27/2023
hey @cxx , what is the error did you ever face the error connection timed out when trying to connect with the mongodb
Ccxx9/28/2023
hey sorry i forgot to post the the way i solved this and honestly i forgot how i did it but if im correct, it have to do with deno resolving dns and adding a . to the string so in order to fix the error rewrite a mongodb dns resolver and check if the resolved dns have a . and remove if it does to be honest im shocked that someone is still facing the same problem with me after several months if you have any more problems, id be happy to help
Ooutofcontext9/29/2023
I haven't faced the same issue but it is similar to this issue, when I try to connect with the mongodb then it always shows the error: connection timed out.. but it is working correctly in node. Yeah!! once I will try this and thank you for responding

Looking for more? Join the community!

Recommended Posts
interact with deno Extension at runtimeIs there any way to interact with an extension at code execution? I need to pass a pointer from my rAny good way to modify remote url file and debug it?For example, I'm using `import server "https://deno.land/x/ultra@v2.1.7/server.ts"` I want to modifyCache related headers not included in deno deploy for static file servingI have a hello world level static site using `serveDir`. When I run the site locally I see that WeakError with relativ import path after "deno install"Is it possible that imports in deno.json are ignored after "deno install"? ```bash deno run ./my-Run examples on WindowsAnyone know how to run the `Piping to files` example on Windows? https://deno.land/manual@v1.30.3/exPython alternative to ctypes, can't figure how to convert a codeHello, I am trying to convert a Python ctypes code to Deno using FFI, but can't know why its not woSuggestions for minimal JSX rendering?Any suggestions for rendering jsx to a string (or ideally a stream), in the most minimal manner fromDeno.run Strange IssueI use `Deno.run` + stdout/signals/etc a lot, but this behavior is beyond my current debugging abilitProperly continuously read data from a ReaderWhat's the proper way to continuously read from a `Deno.Reader`? I'm trying to parse incoming HTTP2npm:redis – everything returns `string`?Every command I try to use from `npm:redis` seems to have inferred return type `string`. Look at theMy magic middlewares typeIf anyone wants a typescript challange here is one: I am trying to create a tuple type which containRead one byte at a time from ReadableStreamWhat would be the most obvious way to read a single byte from a ReadableStream at a time?My deno.lock file exceeds 4000 lines of JSON nowIs this common for application projects? Is there any nice way to clean it up?importing packages breaks typesIm importing `Receiver` from https://deno.land/x/upstash_qstash@v0.3.2. but as soon as i import thisBug report: deno.land website returns a 500 error for JS filesOn https://deno.land, I noticed that the Node vs Deno comparison didn't seem to do anything. From Deno stopps at file.read()I am currently working on a way to communicate with a COM device. I can successfully open and read f[Resolved][Fresh] How to load data asynchronously after rendering a page ?Hi ! I was wondering if someone could help me understand the paradigm to load data asynchronously afSupabase Auth UI in FreshI'm building a simple web. I'd like to use Supabase's Auth UI, namely the `Auth` component, for handAny tool that will complie my TS code to JS?I have coded a website in typescript using Deno, but I want to convert it to JS code. I know the DenHow to get remote IP address when using Deno.serve?I'm using connInfo when using Deno from STD but the native http server doesn't seem to have such int