item_rm_recursive: Remove an item completely by recursively removing its child...

View source: R/item_rm_recursive.R

item_rm_recursiveR Documentation

Remove an item completely by recursively removing its child items

Description

BEWARE: This completely removes ALL CHILD ITEMS AND THEIR CHILDREN as well as the item itself.

Usage

item_rm_recursive(id, ..., limit, session = current_session())

Arguments

...

Additional parameters are passed on to GET, POST, HEAD, PUT, or DELETE

session

Session object from authenticate_sb. Defaults to anonymous or last authenticated session

sb_id

An sbitem object or a character ScienceBase ID corresponding to the item

Value

TRUE to indicate success

Examples

## Not run: 
# Create an item with nested structure
authenticate_sb()
fname <- "chairs"
folder = folder_create(user_id(), name = fname)
item_create(folder, title='child1')
item_create(folder, title='child2')

item_list_children(folder)

# then delete the whole folder
sbtools:::item_rm_recursive(folder)

## End(Not run)

sbtools documentation built on May 1, 2023, 1:07 a.m.