docdb_get: Get all documents from container in database

View source: R/get.R

docdb_getR Documentation

Get all documents from container in database

Description

Get all documents from container in database

Usage

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

Arguments

src

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

key

(character) The name of the container in the database backend (corresponds to collection for MongoDB, dbname for CouchDB, index for Elasticsearch, and to a table name for DuckDB, SQLite and PostgreSQL)

limit

(integer) Maximum number of documents to be returned. If NULL or not set (default), 10,000 for Elasticsearch and all documents 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

Value

A data frame, one document per row

Examples

## Not run: 
src <- src_sqlite()
docdb_create(src, "mtcars", mtcars)
docdb_get(src, "mtcars", limit = 10L)

## End(Not run)

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