![]() I am in my learning phase and was looking forward to learn databases for backend but this has stopped me and i cannot go forward. You can also enter a connection string, click the 'connect with a connection string' link and paste the connection string. restarting wsl mongo server as well as windows mongo server. To connect to a MongoDB database, select Add Connection and enter the connection details for the database then Connect, the default is a local MongoDB server at mongodb://127.0.0.1:27017.reinstalling everything(including wsl2). If you are connecting to a remote server, under the SSH Tunnel field, select Use Password.I have spend 4 hours searching on the for the solution trying everything Connection is possible using its IP 10.111.11.111, give it in Hostname in MongoDB Compass client. When nothing worked i even stopped windows mongo services and tried to only run mongo server in wsl and it got connected with the mongodb compass but then also my code gave same error. ![]() This is my filesystem for the express app MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017Īt _handleConnectionErrors (/home/tanjiro/Programming/WebD/MongoDb/fruitsDB/node_modules/mongoose/lib/connection.js:792:11)Īt NativeConnection.openUri (/home/tanjiro/Programming/WebD/MongoDb/fruitsDB/node_modules/mongoose/lib/connection.js:767:11)Īt runNextTicks (node:internal/process/task_queues:60:5)Īt listOnTimeout (node:internal/timers:540:9)Īt process.processTimers (node:internal/timers:514:7) home/tanjiro/Programming/WebD/MongoDb/fruitsDB/node_modules/mongoose/lib/connection.js:792 I got output Server is running on port 3000 This is the code const express = require('express') Ĭonst mongoDb = "mongodb://127.0.0.1:27017/shopDB"Ĭonsole.log("Server is running on port 3000") MongoDB provides official packages for the graphical tool for Ubuntu and RHEL-based Linux distributions, as well as Windows and MacOS. I make sure the mongo server was running by using sudo systemctl status mongod active services Step 1 Installing MongoDB Compass To use MongoDB Compass, you must install it on your local computer. For a list of drivers and links to driver documentation, see Drivers. Solutions The solution to this issue may depend on how your MongoDB environment is configured. My code is simple and very basic i wanted to start mongoose for the first time in wsl using vscode Connection String Options Examples This document describes the URI formats for defining connections between applications and MongoDB instances in the official MongoDB Drivers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |