skip to Main Content

Mongodb returns an empty array while retrieving data through nodejs

let mongodb = require('mongodb').MongoClient; let express = require("express") let app = express() let connectionString = 'mongodb://ToDoAppUser:[email protected]:27017,ac-u9kgapm-shard-00-01.8rdkdoi.mongodb.net:27017,ac-u9kgapm-shard-00-02.8rdkdoi.mongodb.net:27017/?ssl=true&replicaSet=atlas-68qno6-shard-0&authSource=admin&retryWrites=true&w=majority' let db mongodb.connect(connectionString,function(err,client){ if (err) throw err db = client.db() app.listen(3000) console.log("Database connected."); }) app.use(express.urlencoded({extended : false})) Trying to retrieve data from MongodB As…

VIEW QUESTION

How do you push a string into all users documents in a mongodb collection?

This is my subcommand code: .addSubcommand(subcommand => subcommand .setName('announcement') .setDescription('Announce something to every user. ') .addStringOption(option => option .setName('announcement1') .setDescription('Announcement content') .setRequired(true))), This is my code so far for the command: if (interaction.options.getSubcommand() === 'announcement') { const ann = interaction.options.getString('announcement1')…

VIEW QUESTION

asp.net mongo db 'System.TimeoutException: A timeout occurred after 30000ms' in docker compose

I'm getting this error in my asp.API docker-compose logs fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request. System.TimeoutException: A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 }, OperationsCountServerSelector…

VIEW QUESTION
Back To Top
Search