DEV Community

Mahesh K
Mahesh K

Posted on • Edited on

R Language : Connect to CouchDB Database

I never really had the time to get to fetch much of the data from the NoSQL database. But I was asked to find out ways to interface with them recently. And so I was trying to find out ways to connect to the CouchDB and MongoDB. It seems like a lot of people make use of the CouchDB database. So I thought those who wish to interface with CouchDB from R language can look at this article for a way out of this.

Step 1. Install the Drivers

You can check out the drivers like Sofa and R4CouchDB.

(There are many other drivers too but two of these are enough for most of the needs). You can check the video instruction here. R Language Connect to CouchDB Database.

Let's assume you want R4CoouchDB. So let's install it.

install.packages("R4CouchDB")
Enter fullscreen mode Exit fullscreen mode

Step 2. Create Connection Object

conn <- cdbIni()
Enter fullscreen mode Exit fullscreen mode

Step 3. Check the server response.

conn$serverName
Enter fullscreen mode Exit fullscreen mode

Step 3. Explore the specific queries

From here onwards you can go ahead and make the queries to go through the data. And here you can store or update and delete the content from the data.

You can check out the specific queries in the github readme.

You can also check out some of the examples on the Wiki.

Additional references:

  1. You can also learn how to Connect R language to MySQL database.
  2. Learn how to connect to SQLite from R Language.

Top comments (0)