Learn R Programming

nodbi (version 0.9.0)

docdb_get: Get all documents from container in database

Description

Get all documents from container in database

Usage

docdb_get(src, key, limit = NULL, ...)

Value

Document(s) in a data frame

Arguments

src

Source object, result of call to any of functions src_mongo(), src_sqlite(), src_elastic(), src_couchdb() or src_postgres()

key

(character) A key as name of the container (corresponds to parameter collection for MongoDB, dbname for CouchDB, index for Elasticsearch and to a table name for SQLite and for PostgreSQL)

limit

(integer) Maximum number of documents to return (defaults 10,000 for Elasticsearch and all for MongoDB, SQLite, CouchDB, PostgreSQL, and DuckDB

...

Passed on to functions:

  • MongoDB: find() in mongolite::mongo()

  • SQLite: ignored

  • Elasticsearch: elastic::Search()

  • CouchDB: sofa::db_alldocs()

  • PostgreSQL: ignored

  • DuckDB: ignored

Examples

Run this code
if (FALSE) {
src <- src_sqlite()
docdb_create(src, "mtcars", mtcars)
docdb_get(src, "mtcars", limit = 10L)
}

Run the code above in your browser using DataLab