nodbi (version 0.10.4)

docdb_exists: Check if container exists in database

Description

Check if container exists in database

Usage

docdb_exists(src, key, ...)

Value

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

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 DBI::dbListTables(), elastic::index_exists(), and sofa::db_info()

Examples

Run this code
if (FALSE) {
src <- src_sqlite()
docdb_exists(src, "nonexistingcontainer")
docdb_create(src, "mtcars", mtcars)
docdb_exists(src, "mtcars")
}

Run the code above in your browser using DataLab