WindmillWWindmill
Powered by
vinzceV
Windmill•11mo 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,388Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

We're live here https://discord.com/channels/930051556043276338/1278977038430240813

henri-c · 6d ago

rubenf

Infrastructure as code

rubenf · 4w ago

rubenf

As we're preparing for a new Windmill sandbox SDK, we took the opportunity **to open-source NSJAIL sandboxing** and make it available in CE and easier to set. In 1.634.0, just set nsjail to benefit from the tightest security and isolation per job. It's constraining so no need to use it unless you need but now you won't be restricted in security for CE if you need to.

rubenf · 4w ago

Similar Threads

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