skip to Main Content

Unable to connect to docker mongo db from spring

I am trying to connect to my docker mongo db. I have this docker-compose: version: '3.8' services: mongo: image: mongo container_name: mongodb restart: always environment: MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: example mongo-express: image: mongo-express container_name: mongo-express restart: always ports: - 8081:8081 environment:…

VIEW QUESTION

Azure – {Resolved} {Thanks to those who helped me!} MongoServerSelectionError: Server selection timed out after 30000 ms

This is resolved. Please look at the answers I am following this lab: https://github.com/AzureCosmosDB/Azure-OpenAI-Node.js-Developer-Guide/tree/main/Labs/first_cosmos_db_application After I received errors, I just copied the lab code so there should not be code side errors. In my .env file, I have: MONGODB_URI=mongodb+srv://<user>:<password>@phase-1-db.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000 where…

VIEW QUESTION

Mongodb – The signature '(inputId: number): ObjectId' of 'ObjectId' is deprecated, use static createFromTime() to set a numeric value for the new ObjectId

I am trying to fetch a single product using ObjectId, but wherenever I am writing the code: const { ObjectId } = require('mongodb'); static findById(product_id) { // console.log("Collected product id:",product_id); //db is the database return db.collection('Product_data').find({"_id":new ObjectId(product_id)}).next() .then(singleData=>{ return singleData;…

VIEW QUESTION
Back To Top
Search