Delete documents or container
Arguments
- src
Source object, result of call to any of functions
src_mongo(),src_sqlite(),src_elastic(),src_couchdb()src_duckdb()orsrc_postgres()- key
(character) The name of the container in the database backend (corresponds to
collectionfor MongoDB,dbnamefor CouchDB,indexfor Elasticsearch, and to a table name for DuckDB, SQLite and PostgreSQL)- ...
Optionally, specify
queryparameter with a JSON string as perdocdb_query()to identify documents to be deleted. If not specified (default), deletes the containerkey.
Value
(logical) Success of operation. Typically TRUE if
document(s) or collection existed, and FALSE if document(s)
did not exist, or collection did not exist, or delete was not successful.
Examples
if (FALSE) { # \dontrun{
src <- src_sqlite()
docdb_create(src, "iris", iris)
docdb_delete(src, "iris", query = '{"Species": {"$regex": "a$"}}')
docdb_delete(src, "iris")
} # }
