# NOT RUN {
endp <- cosmos_endpoint("https://myaccount.documents.azure.com:443/", key="mykey")
db <- get_cosmos_database(endp, "mydatabase")
cont <- create_cosmos_container(db, "mycontainer", partition_key="sex")
# importing the Star Wars data from dplyr
bulk_import(cont, dplyr::starwars)
# deleting a subset of documents
bulk_delete(cont, "select * from mycontainer c where c.gender = 'masculine'")
# deleting documents for a specific partition key value
bulk_delete(cont, "select * from mycontainer", partition_key="male")
# deleting all documents
bulk_delete(cont, "select * from mycontainer")
# }
Run the code above in your browser using DataLab