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

234
Views
¿Por qué mi código no puede conectarse a Mongo DB?

Estoy tratando de apuntar mi código R a mi mongodb.

Tengo un config.yml :

 default: host: "cluster0.qixym.mongodb.net" username: "****" password: "****" production: host: "cluster0.qixym.mongodb.net" username: "****" password: "****"

Aquí está mi código:

 # MONGO DB TRAINING ----- # Version 1 # LIBRARIES ---- library(mongolite) # Resource: https://jeroen.github.io/mongolite/ library(jsonlite) library(config) library(tidyverse) library(lubridate) # 1.0 CONNECTION TO REMOTE MONGODB ---- # Setup config Package & database YAML Sys.setenv(R_CONFIG_ACTIVE = "default") config <- config::get(file = "config.yml") mongo_connect <- function(collection, database, username = config$username, password = config$password, host = config$host){ mongo( collection = collection, url = str_glue("mongodb+srv://{username}:{password}@{host}/{database}/?tls=true"), options = ssl_options(weak_cert_validation = T) ) } # Connect to MongoDB Atlas Cloud Database mongo_connect(collection = "mtcars", database = "rstats")

Obtuve el siguiente error:

** Error en (función (uri = "mongodb://127.0.0.1", pem_file = NULL, pem_pwd = NULL, : error al analizar URI: p (Nombre de base de datos no válido en URI) **

Miré este hilo pero no pude encontrar una solución: https://github.com/jeroen/mongolite/issues/219

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

¡Entonces el código anterior funciona!

¡El problema era que tenía caracteres especiales en mi contraseña!

https://docs.mongodb.com/manual/reference/connection-string/#components

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!