docdb_exists: Check if container exists in database

View source: R/exists.R

docdb_existsR Documentation

Check if container exists in database

Description

Check if container exists in database

Usage

docdb_exists(src, key, ...)

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)

...

Passed to functions:

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

  • RSQLite: DBI::dbListTables()

  • Elasticsearch: elastic::index_exists()

  • CouchDB: sofa::db_info()

  • PostgreSQL: DBI::dbListTables()

  • DuckDB: DBI::dbListTables()

Value

(logical) TRUE or FALSE to indicate existence of container key in database. Note this does not mean that the container holds any documents.

Examples

## Not run: 
src <- src_sqlite()
docdb_exists(src, "nonexistingcontainer")
docdb_create(src, "mtcars", mtcars)
docdb_exists(src, "mtcars")

## End(Not run)


nodbi documentation built on Sept. 24, 2023, 1:08 a.m.