2

I'm looking for a way to (conveniently) use R to access data stored in a LiteDB. There does not seem to be a package but is there another way to make it accessible?

  • 1
    It doesn't appear to use ODBC & is .NET-based, so — in all practical sense (I know Mono / `dotnet` exists) — Windows-only (esp since the build of it fails on macOS … I just tried), and no REST API (I understand why that is, tho). What does "conveniently" mean? It seems to have a [decent command-line shell app](https://github.com/mbdavid/LiteDB/wiki/Shell). One approach would be to make a set of convenience functions to build queries/ops, write them to a file and `system()` (et al) exec the litedb shell executable with the `run` litedb shell op. – hrbrmstr Nov 22 '17 at 12:12

1 Answers1

0

This is long shot but, have you tried using the DBI package's generic connect() method?

con <- mongo(<table name>, url = <database_filename>)

I would try testing the MongoDB driver as its a NoSQL database. I don't expect this to work but I believe it's worth trying out.

The only other feasible alternative would be to export the data you need as a CSV file (or alternative) and import that data into R, <readr::read_csv()>.

If you really prefer to work with a database, then migrating to a SQLite database will allow you to use the RSQLite package to work with the data.


Or you could always try to write a driver for LiteDB to fit into the DBI package...

lohithbb
  • 128
  • 1
  • 11