0

I use R version 3.6.2 and I installed mongolite as follows:

install.packages("mongolite")

Then I tried to connect to my MongoDB server as follows (from R):

con <- mongo(url="xxx", collection = "tescollection", db="testdb", verbose = TRUE)

However, it fails with the following error message:

Server at xxx:11155 reports wire version 2, but this version of libmongoc requires at least 3 (MongoDB 3.0)

How can I fix this issue without changing the server's MongoDB version?

I found the solution for php, but I am using R.

I tried to install an earlier version of mongolite as follows, but then it says package ‘mongolite’ is not available (for R version 3.6.2):

install.packages("mongolite", repo="https://cran.r-project.org/src/contrib/Archive/mongolite/mongolite_1.6.tar.gz", lib="library")
Fluxy
  • 2,838
  • 6
  • 34
  • 63

1 Answers1

2

Using devtools should do the trick

devtools::install_version("mongolite", version = "1.6")
niko
  • 5,253
  • 1
  • 12
  • 32
  • can I install it into a specific folder, in my case `library`? – Fluxy Jan 15 '20 at 18:48
  • @Fluxy In the documentation it states `... Other arguments passed on to utils::install.packages().` So you might be able to pass `lib = lib` – niko Jan 15 '20 at 18:50