Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

410
Views
El servidor Nest no se conecta a la nube de MongoDB UnhandledPromiseRejectionAdvertencia: MongoParseError: URI con formato incorrecto

Mi backend de NestJS necesita conectarse a la nube de mongodb, seguí los documentos desde aquí

El siguiente error arrojó en la terminal:

 (node:6920) UnhandledPromiseRejectionWarning: MongoParseError: URI malformed at new ConnectionString (D:\growth\quizbackend\quizbackend\node_modules\mongodb-connection-string-url\src\index.ts:113:13) at Object.parseOptions (D:\growth\quizbackend\quizbackend\node_modules\mongodb\src\connection_string.ts:249:15) at new MongoClient (D:\growth\quizbackend\quizbackend\node_modules\mongodb\src\mongo_client.ts:332:22) at D:\growth\quizbackend\quizbackend\node_modules\mongoose\lib\connection.js:785:16 at new Promise (<anonymous>) at NativeConnection.Connection.openUri (D:\growth\quizbackend\quizbackend\node_modules\mongoose\lib\connection.js:782:19) at Mongoose.createConnection (D:\growth\quizbackend\quizbackend\node_modules\mongoose\lib\index.js:275:10) at Function.<anonymous> (D:\growth\quizbackend\quizbackend\node_modules\@nestjs\mongoose\dist\mongoose-core.module.js:60:63) at Generator.next (<anonymous>) at D:\growth\quizbackend\quizbackend\node_modules\@nestjs\mongoose\dist\mongoose-core.module.js:20:71 (Use `node --trace-warnings ...` to show where the warning was created) (node:6920) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:6920) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Mi código de módulo de aplicación:

 import { Module } from '@nestjs/common'; import { AppController } from './app.controller'; import { AppService } from './app.service'; import { UsersModule } from './users/users.module'; import {MongooseModule} from '@nestjs/mongoose' @Module({ imports: [UsersModule,MongooseModule.forRoot('mongodb+srv://samiurkhan:%$321@cluster0.8rxa2.mongodb.net/nest-js-db?retryWrites=true&w=majority')], controllers: [AppController], providers: [AppService], }) export class AppModule {}

Verifiqué dos veces mi nombre de usuario y contraseña, pero son correctos, ¿hay alguna necesidad de codificarlos o por qué el error arroja cualquier explicación?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Asegúrese de que su nombre de usuario y contraseña en la cadena de conexión URI no tengan caracteres ilegales .

Si el nombre de usuario o contraseña incluye los siguientes caracteres:

 : / ? # [ ] @

esos caracteres deben convertirse utilizando la codificación de porcentaje.

Basado en su documentación: https://docs.mongodb.com/manual/reference/connection-string/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!