skip to Main Content

Mongodb – got and error when i connect mongo db to nodejs

```const timeoutError = new error_1.MongoServerSelectionError(Server selection timed out after ${serverSelectionTimeoutMS} ms, this.description); .MongoServerSelectionError: connect ECONNREFUSED ::1:27017 const {MongoClient}=require('mongodb'); const url='mongodb://localhost:27017/'; const client= new MongoClient(url); const dataBase= 'nodejs'; async function getdata(){ let result= await client.connect(); console.log('connect to server') let db= result.db(dataBase)…

VIEW QUESTION

Redis – Set Expiry time of hsetnx

How to Set expiry time of hsetnx (https://redis.io/commands/hsetnx/) to be 1 hour. Currently i don't see a param where i can set expiry time to it. const IoRedis = require("ioredis"); const redis = new IoRedis(); var message = { "jobdid":…

VIEW QUESTION
Back To Top
Search