WindmillWWindmill
Powered by
vinzceV
Windmill•10mo ago•
3 replies
vinzce

Unable to connect to Atlas in typescript Mongodb

Hello !
I am trying to get data from Atlas Mongodb with Typescript using this code :

import * as wmill from "https://deno.land/x/windmill@v1.450.0/mod.ts";
// import { MongoClient } from "https://deno.land/x/mongo@v0.34.0/mod.ts";
export async function main(
) {
const client = new MongoClient();
const mongodb_connexion = "mongodb+srv://<username>:<password>@cluster0.aavzxle.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0";
// Connecting to a Mongo Atlas Database

const resp = await client.connect(mongodb_connexion)
.catch((err) => {
console.log(err)
})
}
but this is not working throwing this error :
Error: MongoError: "Connection failed: failed to lookup address information: No address associated with hostname"
at MongoClient.connect (https://deno.land/x/mongo@v0.34.0/src/client.ts:61:13)

The same code adapted for Python is working perfectly.
so it is sure there is nothing wrong on the Atlas Mongodb Side. I have whitelisted worker IPs.

Any idea or example ?

And in addition, I executed far too many runs of the typescript code, I reached the quota of executions :
1050/1000 user execs
1050/1000 free workspace execs
By the way what is the difference between user execs and workspace execs ?
Also it seems that execs are counted by seconds of execution. So if one run lasts 1m30, it is counted as 90 execs ?
Thanks.
WindmillJoin
3,362Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

TypeScript(Deno) unable to find types
Evaldas_BEEvaldas_B / help
16mo ago
MongoDB deprecation
LeandroLLeandro / help
16mo ago
unable to use DynSelect in scheduler
TreyTTrey / help
3mo ago
Unable to log in (SSO not working)
bielzoom48Bbielzoom48 / help
2mo ago