src_mongo: Setup a MongoDB database connection

View source: R/src_mongo.R

src_mongoR Documentation

Setup a MongoDB database connection

Description

Setup a MongoDB database connection

Usage

src_mongo(collection = "test", db = "test", url = "mongodb://localhost", ...)

Arguments

collection

(character) Name of collection

db

(character) Name of database

url

(character) Address of the MongoDB server in Mongo connection string URI format, see to mongolite::mongo()

...

Additional named parameters passed on to mongolite::mongo()

Details

Uses monoglite as backend. nodbi creates or uses a MongoDB collection, in which nodbi creates JSON documents. If documents do not have root-level ⁠_id⁠'s, UUID's are created as ⁠_id⁠'s. MongoDB but none of the other databases require to specify the container already in the src_mongo() function. For a benchmark, see https://github.com/ropensci/nodbi#benchmark

Value

A nodbi source object

Examples

## Not run: 
con <- src_mongo()
print(con)

## End(Not run)

nodbi documentation built on Sept. 30, 2024, 1:06 a.m.