Delete documents or container
Arguments
- src
Source object, result of call to any of functions
src_mongo()
,src_sqlite()
,src_elastic()
,src_couchdb()
orsrc_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)- ...
optional
query
parameter with a JSON query as permongolite::mongo()
and as working indocdb_query()
to identify documents to be deleted. The default is to delete the containerkey
. Other parameters are passed on to functions:MongoDB: find() in
mongolite::mongo()
SQLite: ignored
Elasticsearch:
elastic::Search()
CouchDB:
sofa::db_alldocs()
PostgreSQL: ignored
DuckDB: ignored
Value
(logical) success of operation. Typically TRUE
if document
or collection existed and FALSE
is document did not exist or
collection did not exist or delete was not successful.
Examples
if (FALSE) {
src <- src_sqlite()
docdb_create(src, "iris", iris)
docdb_delete(src, "iris", query = '{"Species": {"$regex": "a$"}}')
docdb_delete(src, "iris")
}